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
Use list for relationship(uselist=True) instead of iterable #82
Conversation
I would love this to get merged! I'm curious though, why did |
Probably because you can customize collection by passing If @ilevkivskyi can merge this, then I'll turn from draft into regular PR and finish my work on another branch. If not yet, then I want to wait for #81 (I also need to do some fixes there) so that I can implement dynamic loader too. |
This makes sense. I need to double-check this against our internal code (just in case). There are bunch of open PRs I am going to look very soon, maybe even later this week. |
@ilevkivskyi Any update here? I've unfortunately had to add my own version of |
I think I should at least implement |
@@ -372,7 +372,7 @@ class User(Base): | |||
# We figured out, the model type. Now check if we need to wrap it in Iterable |
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.
This comment should be updated to say list
@rafales Please let me know when this is ready for review. |
@rafales If you tell me exactly what you're thinking with the Alternatively, it seems pretty reasonable to me to merge this now, and add the |
@ckarnell I think it at least should default to |
|
Right now
relationship(uselist=True)
usestyping.Iterable
, which breaks most of our code.Relationship configuration is described in greater detail here: https://docs.sqlalchemy.org/en/13/orm/collections.html
Right now this PR just replaces
typing.Iterable
withlist
.What I plan to do in this PR:
list
when usinguselist=True
collection_class
argument to customize collection class if present (simple type)What can be done later:
dynamic
loader andquery_class
parameters (when Typed queries #81 gets accepted)attribute_mapped_collection
,column_mapped_collection
,mapped_collection
)