ioxiocom / firedantic

Database models for Firestore using Pydantic base models.
BSD 3-Clause "New" or "Revised" License
39 stars 13 forks source link

Add a `.reload()` to models #65

Open joakimnordling opened 4 months ago

joakimnordling commented 4 months ago

It would be handy to have a .reload() on the models to re-fetch them from the DB instead of having to manually get the id and then load by id. This would be especially useful when writing unittests if you want to check an API modified a model as expected.

For reference Arangodantic has such functionality.

antont commented 4 months ago

Yep my tests do a lot of such refreshing too, so +1 for the need from here. No idea about the best design but maybe it's just such a reload method indeed.