hackforla / hackforla/knowledgebase

Data: Populate asset type

Abierto
#44 0 comentarios 0 reacciones 0 asignados Ver en GitHub
category: populate complexity: medium complexity: small dependency draft feature: table: asset type milestone: missing role: back end dev size: 1pt
Lenguaje dominante
Python
Estrellas
2
Forks
5
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

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

Guía de contribución

Abrir la guía de contribución

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.