Replies: 1 comment
-
Hi, this is not supported as a setting but could be achieved by overriding Something like class Base(ModelFactory):
__is_abstract_factory__ = True
@classmethod
def should_set_field_value(cls, field_meta: FieldMeta, **kwargs: Any) -> bool:
return super().should_set_field_value(field_meta) and hasattr(cls, field_meta.name) Note above is untested and may not fully work for some cases around inheritance |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
I’m using Polyfactory with a Pydantic class and would like to stop auto-generating values for fields like
some_text_variable
without explicitly usingIgnore()
for each one.Example:
Is there a way to globally disable or streamline this without manually defining each field?
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions