Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

3w: Create models structure #443

Closed
batpad opened this issue Jun 25, 2019 · 5 comments
Closed

3w: Create models structure #443

batpad opened this issue Jun 25, 2019 · 5 comments

Comments

@batpad
Copy link
Collaborator

batpad commented Jun 25, 2019

For the who-what-where frontend, we need a new model structure to store this data (alongwith new frontend forms).

We can base the model structure off the form in the design: https://projects.invisionapp.com/share/P9SA110GT4S#/screens/369905382

Fields:

  • Reporting National Society (select National Society)
  • Country + Province (Foreign Key to District)
  • Project Name (Text)
  • Type of Programme Sector (ENUM) - choices are Multilateral, Bilateral - anything else? @guipizzini
  • Sector of Activity (ENUM) - @guipizzini could you help with what all choices for this field will be?
  • Start Date (Date)
  • End Date (Date)
  • Budget Amount (Integer?)
  • Budget Currency - ENUM? What are valid currencies that we support? @guipizzini
  • Project Status (ENUM) - What are the options here? @guipizzini

@szabozoltan69 do you think it makes sense to create a new django app for this, like you have done with per? The models.py file in the api/ app has gotten very big and I don't want to add more things there. I can either make it a separate app or first work on splitting up api/models.py into smaller files (which maybe we should do anyway).

@guipizzini let me know if the above field structure seems about right and we can go ahead and create the models in the database to hold the data.

@batpad batpad mentioned this issue Jun 25, 2019
@szabozoltan69
Copy link
Contributor

@batpad Yes, it's a good idea to create a new django subdir for this, really! If there are connections to already existing tables, it's easy to connect the data.

@batpad
Copy link
Collaborator Author

batpad commented Jun 27, 2019

Pasting @guipizzini's reponses here:

- only CHF as a currency
- Project Status options here: (Ongoing / Completed / Planned)
- IFRC Sectors are here: (WASH, PGI, CEA, Migration, Health, DRR, Shelter, Preparedness)
- Programme options are only multilateral and bilateral

@szabozoltan69 based on the above, I think we can remove the Currencies Enum altogether as well as the budget_currency field in the model (since it is always CHF). And we can make changes to the other Enum field options as per above.

@szabozoltan69
Copy link
Contributor

szabozoltan69 commented Jun 27, 2019

Changes made. :-) Continuing work with "create" (and the tests which check the features).

@batpad batpad added this to Goals in IFRC Go Phase 3 Jun 27, 2019
@batpad batpad moved this from Goals to In Progress in IFRC Go Phase 3 Jun 27, 2019
@batpad
Copy link
Collaborator Author

batpad commented Jun 27, 2019

I just took another look at the data structure for the current Deployments feature. You can see the models here: https://github.com/IFRCGo/go-api/blob/master/deployments/models.py

@guipizzini I may need some more help understanding how the current deployments data fits in with the new data model we have added for Projects - in how the data is stored, as well as displayed on thew frontend.

Also, if both these fit under the broad umbrella of Who-What-Where, @szabozoltan69 I wonder if we should put the models and code we put in the w3 folder, just into the deployments folder. But let's not worry about that now -- if it seems like we should do that, I can make the change after everything is ready and before merging.

@batpad
Copy link
Collaborator Author

batpad commented Jun 27, 2019

This is done!

@batpad batpad closed this as completed Jun 27, 2019
@batpad batpad moved this from In Progress to Done in IFRC Go Phase 3 Jun 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Development

No branches or pull requests

2 participants