You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I want to implement a updated_at field that contains the Date/Time of the last update. This can easily be implemented with such a function. Other use cases include a field that is dependent on another field eg.: file_extention = "pdf" is dependent on file_path = "/home/Documents/test.pdf"
Solution
Add a "pre_save()" function in the "Model" class that can be implemented by Models. Call this function from the "engine._save()".
Alternative solutions
Calling a function every "save" manually.
Additional context
If added, this has also be added to the documentation.
The text was updated successfully, but these errors were encountered:
Feature request
Add a function which is called before saving.
Context
I want to implement a updated_at field that contains the Date/Time of the last update. This can easily be implemented with such a function. Other use cases include a field that is dependent on another field eg.: file_extention = "pdf" is dependent on file_path = "/home/Documents/test.pdf"
Solution
Add a "pre_save()" function in the "Model" class that can be implemented by Models. Call this function from the "engine._save()".
Alternative solutions
Calling a function every "save" manually.
Additional context
If added, this has also be added to the documentation.
The text was updated successfully, but these errors were encountered: