hackforla / hackforla/knowledgebase

Data: Populate asset type

Aperta
#44 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub
category: populate complexity: medium complexity: small dependency draft feature: table: asset type milestone: missing role: back end dev size: 1pt
Lingua principale
Python
Stelle
2
Fork
5
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

### 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.

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.