Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FR] Add __post_init__ equivalent #689

Open
Zocker1999NET opened this issue Jul 7, 2023 · 1 comment
Open

[FR] Add __post_init__ equivalent #689

Zocker1999NET opened this issue Jul 7, 2023 · 1 comment

Comments

@Zocker1999NET
Copy link

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.

@JoshYuJump
Copy link
Contributor

Maybe you can take a look at hooks
https://docs.ponyorm.org/api_reference.html#entity-hooks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants