-
-
Notifications
You must be signed in to change notification settings - Fork 27
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
Relationship fails when attribute name != column name #21
Comments
@TimDumol , we ran into this issue ourselves and see errors from two places where the relationship value is resolved on the respective row using the sql_column_name rather than the python_attr_name StrawberrySQLAlchemyLoader#loader_for
StrawberrySQLAlchemyMapper#relationship_resolver_for
We have a temporary work around by overriding the respective methods and building a I'm happy to contribute a fix if we can agree an approach. Example fix:
|
Hi @cpsnowden - sorry totally forgot I assigned myself to this. Your proposed fix looks good to me. Feel free to PR it! |
Thanks @TimDumol - see that @gravy-jones-locker is addressing this in #25 |
My model has a
Survey
class withowner_id
attribute, which is using a different column name (user_id
) for historic reasonsIn
relationship_resolver_for
, the code tries to accessgetattr(self, sql_column_name)
instead ofgetattr(self, python_attr_name)
Upvote & Fund
The text was updated successfully, but these errors were encountered: