Tefnet Developers wrote: > > Dnia 2009-08-27, czw o godzinie 10:51 -0400, Michael Bayer pisze: > >> you can also set up primaryjoin using the actual table >> columns (i.e. PhysObject.locationId == Location.__table__.c.id). >> > > Thanks, that worked really well :). Now i am stuck with something else > in this subject: > > ===================================================================== > # available at http://filip.math.uni.lodz.pl/column_pairs.py > # Fails with Python-2.5.4 and SQLAlchemy-0.5.5 > > import sqlalchemy > import sqlalchemy.ext.declarative > > ''' > Fails with: > > File > "/usr/lib/python2.5/site-packages/SQLAlchemy-0.5.4p2-py2.5.egg/sqlalchemy/orm/properties.py", > line 836, in _determine_synchronize_pairs > "marked as viewonly=True." % (self.primaryjoin, self) > sqlalchemy.exc.ArgumentError: Could not locate any equated, locally > mapped column pairs for primaryjoin condition '"PhysObject"."locationId" > = "Location"."Id"' on relation PhysObject.location. For more relaxed > rules on join conditions, the relation may be marked as viewonly=True. > > ''' > > I want to put definining .locationId and .location into one function, so > I need to assing .locationId outside of the PhysObject class definition. > > Is using Mapper._configure_inheritance() a proper approach? > >
no that is not something that should be done here at all, that's an internal configuration function and if it "works" its something entirely accidental. The way you're configuring seems a little awkward (column_property and such) can you just try making it a little more "normal" ? the join condition being received is not being parsed at all for some reason. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To post to this group, send email to sqlalchemy@googlegroups.com To unsubscribe from this group, send email to sqlalchemy+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en -~----------~----~----~----~------~----~------~--~---