hackforla / hackforla/knowledgebase

Data: Populate asset type

未关闭
#44 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
category: populate complexity: medium complexity: small dependency draft feature: table: asset type milestone: missing role: back end dev size: 1pt
主要语言
Python
星标
2
派生
5
PR 合并指标
30 天内没有已合并 PR

描述

### Dependencies
- #29

### Overview
As a BOP or Toolkit user, I want to see what application was used to create the asset.

### Action Items
This is an outline of possible steps. You may need to investigate other ways to accomplish the task or fine tune the steps below.
- [ ] Look at [Wiki](../wiki) with "Data"
- [ ] Create a file asset_types.json with the id, asset category, and name
- [ ] Create a script named 000[x]_phase_seed.py in data/migrations folder, where x is one more than the highest sequenced script in the folder
- [ ] Using 0004_populate_phase as a model
- [ ] Update dependencies to point to the next higher script
- [ ] Create a run function that loops through asset types json:
- [ ] Get id for the asset category equal to json_data["category"]
- [ ] call AssetType.objects.update_or_create( id = json_data["id"], asset_types.asset_category_id = json_data["category_id"], name = json_data["name") - you can also try **json_data
- [ ] Run source ./start-dev.sh. This will run migration which should execute the script
- [ ] Correct any errors

### How to Manually Verify
- Run `source ./start-dev.sh` from django_root directory
- Log into kb app
- Navigate to Asset screen
- Verify records appear

### Automated Tests
This will be done as part of a different issue.

贡献指南

打开贡献指南

调研方向

首先检查依赖项 #29 和 Wiki 的 Data 部分。以 data/migrations/0004_populate_phase 作为迁移模型,添加 asset_types.json 和下一个编号的迁移,然后从 django_root 运行 source ./start-dev.sh。迁移完成且 Asset 屏幕显示预期记录即表示完成。

由索引模型根据 Issue 内容生成。

评估

技术栈
django, python
领域
backend, database
Issue 类型
功能
难度
3/5
预计耗时
1-2 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
35/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。