El 11/09/17 a las 14:52, Mike Bayer escribió: > Please provide all mappings including the missing "Prestacion" class > as well as exact information on which classes have their own tables or > not. The code should be a mappings I can paste into a .py file and > run to see the error you are getting.
Sorry, I missed a number of translastions. "Prestacion" is the original, untranslated/untamed name of the "Charge" class. I made complete, runnable example here: https://bitbucket.org/snippets/shulai/A8X78B The bottom half is only provided in order to show how classes are used, as the issue is not there. >> Being a bit awkward, It worked well and silently on SQLAlchemy 0.8.x and >> 0.9.x. I went into production using 0.9.x. >> >> But when using 1.x versions I got: >> >> SAWarning: relationship 'Charge.family_member' will copy column >> affiliate_family_members.affiliate_id to column >> charges.affiliate_id, which conflicts with relationship(s): >> 'Charge.affiliate' (copies affiliates.id to charges.affiliate_id). >> Consider applying viewonly=True to read-only relationships, or >> provide a primaryjoin condition marking writable columns >> with the foreign() annotation. >> >> Besides being a warning, I'm not sure if this actually can broke >> something (Some problems I got trying to use 1.0.x days made me think >> so). So I tried to fix it, but it's not as easy as it seemed. >> >> The gist is that in certain Charge subclasses I need affiliate being a >> regular relationship, in other subclasses I need affiliate being a >> "viewonly" relationship. But as all subclasses share the same mapper, >> relationships from different subclasses clash one with each other: >> >> SAWarning: relationship 'PharmacyPurchase.family_member will copy >> column family_members.affiliate_id to column >> charges.affiliate_id which conflicts with relationship(s): >> 'LoanCharge.affiliate' (copies affiliates.id to charges.affiliate_id). >> Consider applying viewonly=True to read-only relationships, or >> provide a primaryjoin condition marking writable columns >> with the foreign() annotation. >> >> I'm not sure there is really a solution, besides using separate fields >> for both relationships, as that should be an endeavor I'd rather avoid. >> >> Any suggestions? TIA. Julio. -- SQLAlchemy - The Python SQL Toolkit and Object Relational Mapper http://www.sqlalchemy.org/ To post example code, please provide an MCVE: Minimal, Complete, and Verifiable Example. See http://stackoverflow.com/help/mcve for a full description. --- You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To unsubscribe from this group and stop receiving emails from it, send an email to sqlalchemy+unsubscr...@googlegroups.com. To post to this group, send email to sqlalchemy@googlegroups.com. Visit this group at https://groups.google.com/group/sqlalchemy. For more options, visit https://groups.google.com/d/optout.