ioxiocom / firedantic

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

`after_load`, `before_save` and `after_save` #12

Open lietu opened 3 years ago

lietu commented 3 years ago

Would be nice to get a couple of hook functions, to automatically run things before or after saving is complete, and if possible they should get list of changed fields or at least if the model is new or not as an argument.

steveobd commented 3 months ago

I'm in the process of wrapping this library to make it more NDB-like. Guido did a lot of things right with it so perhaps look for inspriation https://github.com/googleapis/python-ndb/blob/982f8a70dfa4b940c162ce327441099aca982d21/google/cloud/ndb/model.py#L6226