-
Notifications
You must be signed in to change notification settings - Fork 95
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
Using attribute with RelatedList doesn't work #340
Comments
After creating the PR - I saw that there is already a test marshmallow-sqlalchemy/tests/test_model_schema.py Lines 393 to 404 in 7cdb69f
where it shows that I would need to do:
But I'm not sure if that is intuitive, because the attribute should be for the main field in the schema ? I see that this isn't a problem when using marshmallow-sqlalchemy/src/marshmallow_sqlalchemy/convert.py Lines 141 to 149 in 7cdb69f
|
Seems like I have another issue with RelatedList and field_for(School, 'teachers', validate=lambda x: len(set(x)) == len(x)) It throws an error that Teacher is not itearable. Becuase this validator is also being applied to both: @sloria - Wanted to check if it makes sense and whether a fix to decouple the kwargs for RelatedList and Related would be accepted ? |
@AbdealiJK Yeah, that does look like a a bug-- |
When I am using a RelatedList with an
attribute=
loading the relationship seems to cause an error about unknown attributes.For example, if the Models are:
My schema is defined as:
Now when I try to use is:
I get the error:
The text was updated successfully, but these errors were encountered: