feat: post_create and post_generate hooks#667
Open
iloveitaly wants to merge 3 commits intolitestar-org:mainfrom
Open
feat: post_create and post_generate hooks#667iloveitaly wants to merge 3 commits intolitestar-org:mainfrom
iloveitaly wants to merge 3 commits intolitestar-org:mainfrom
Conversation
Collaborator
|
Can the above functionality be achieved by overriding |
Contributor
Author
It can, but:
|
adhtruong
reviewed
Mar 24, 2025
Collaborator
adhtruong
left a comment
There was a problem hiding this comment.
The above feels like could be handled with docs if wanted to handle that case? Not opposed to adding though depending what other @litestar-org/maintainers think.
|
Documentation preview will be available shortly at https://litestar-org.github.io/polyfactory-docs-preview/667 |
Contributor
Author
|
@adhtruong addressed PR feedback! |
Contributor
Author
|
@adhtruong anything else you need done here besides removing conflicts? |
Collaborator
|
@iloveitaly changes and tests look good. Happy to merge once conflicts are resolved and documentation is added |
iloveitaly
pushed a commit
to iloveitaly/polyfactory
that referenced
this pull request
Nov 14, 2025
Added comprehensive documentation for the new lifecycle hooks: - Created two example files demonstrating post_build and post_generate usage - Added "Lifecycle Hooks" section to configuration.rst documentation - Examples show practical use cases: - post_build: Modifying created instances (e.g., auto-verifying test accounts) - post_generate: Computing derived fields before model creation (e.g., calculating total price with tax) Addresses reviewer feedback on PR litestar-org#667 requesting documentation.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Two additional hooks:
I can write some additional tests for this, but wanted to get some initial feedback first.