Replies: 2 comments 2 replies
-
Looks like
|
Beta Was this translation helpful? Give feedback.
0 replies
-
there is a method to get_faker() on the factory. What exactly are you trying to achieve? |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
We have a model that is linked to another with a root validator that checks to ensure the one of the child attributes is prefixed by data from the parent attribute:
Assuming an instance of
Widget
is owned by aTeam
with ashort_name
of "foo", thename
of the widget must be "foo-".Is this a use case for the
PostGenerated()
helper:https://starlite-api.github.io/pydantic-factories/usage/4-defining-factory-fields/#postgenerated
I'm wondering if the model will fail validation before I even get to
PostGenerated()
...Is it possible to access the instance attributes during generation? Perhaps I could override
get_field_value()
...Thanks in advance for any thoughts.
Beta Was this translation helpful? Give feedback.
All reactions