-
-
Notifications
You must be signed in to change notification settings - Fork 85
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
feat(sqla_factory): added __set_association_proxy__ attribute #624
base: main
Are you sure you want to change the base?
Conversation
…xt manager to SQLAASyncPersistence class
Documentation preview will be available shortly at https://litestar-org.github.io/polyfactory-docs-preview/624 |
""" | ||
data: dict[str, Any] = cls.process_kwargs(**kwargs) | ||
for k, v in data.items(): | ||
if isinstance(v, Coroutine): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this behaviour generally used for other async methods or more specific to SQLA relationships? If specific to SQLA then should live within that factory
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I should check a bit, but could suppose this is more specific for SQLAlchemy proxy. If this behaviour is only for the Alchemy, I'll try to think something and leave it within SQLAlchemy factory.
@@ -213,6 +218,23 @@ def get_model_fields(cls) -> list[FieldMeta]: | |||
random=cls.__random__, | |||
), | |||
) | |||
if cls.__set_association_proxy__: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice. Adding as a feature makes sense here. Can appropriate tests and documentation be added for this feature please?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Ok, I'd try to do that.
Description