CAVaccineInventory / vial

The Django application powering calltheshots.us
https://vial.calltheshots.us
MIT License
13 stars 1 forks source link

Use the pydantic __get_validators__ method on Django ORM models in more places #510

Open simonw opened 3 years ago

simonw commented 3 years ago

I experimented with this in #471 and I like it. For consistency, should use this pattern elsewhere in the codebase too:

https://github.com/CAVaccineInventory/vial/blob/d909cfe1875a1ee986c17916468a7789e74ec972/vaccinate/core/models.py#L1083-L1100

https://github.com/CAVaccineInventory/vial/blob/d909cfe1875a1ee986c17916468a7789e74ec972/vaccinate/api/views.py#L775-L786

simonw commented 3 years ago

This would benefit: https://github.com/CAVaccineInventory/vial/blob/d909cfe1875a1ee986c17916468a7789e74ec972/vaccinate/api/views.py#L690-L692

simonw commented 3 years ago

A bigger job is using it for this: https://github.com/CAVaccineInventory/vial/blob/d909cfe1875a1ee986c17916468a7789e74ec972/vaccinate/api/views.py#L53-L120