hackforla / hackforla/knowledgebase
Data: Populate asset type
- Ngôn ngữ chính
- Python
- Star
- 2
- Fork
- 5
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Mô tả
### 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.
Hướng dẫn đóng góp
Hướng nghiên cứu
Start by checking dependency #29 and the Data section of the Wiki. Use data/migrations/0004_populate_phase as the migration model, add asset_types.json and the next numbered migration, then run source ./start-dev.sh from django_root. Done means the migration completes and the Asset screen shows the expected records.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- django, python
- Lĩnh vực
- backend, database
- Loại issue
- Tính năng
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Khá rõ ràng
- Mức phù hợp với người mới
- 35/100