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
It would be great to have something for Pony entities which works similar to the __post_init__ method for dataclasses, allowing to modify or further set up an entity object directly after it was created, without requiring to override Pony’s `init and then call it again with the same arguments.
This should be relatively easy to implement. However, while looking through Pony’s code, I don’t seem to get where this call should happen.
The text was updated successfully, but these errors were encountered:
The entity hooks were not helpful in my case as those (if I understand them correctly) trigger when interacting with the database. However, I wanted to adjust the defaults of some properties depending on other, given attributes & I would prefer if those dynamic defaults would already be applied before the object is stored into the DB.
(I just saw your suggestion again & thought I could answer it through I do not need a __post_init__ anymore but I think this might still be helpful.)
It would be great to have something for Pony entities which works similar to the
__post_init__
method for dataclasses, allowing to modify or further set up an entity object directly after it was created, without requiring to override Pony’s `init and then call it again with the same arguments.This should be relatively easy to implement. However, while looking through Pony’s code, I don’t seem to get where this call should happen.
The text was updated successfully, but these errors were encountered: