[sqlalchemy] Re: Problem with defining relations between inherited classes

2009-08-29 Thread Tomasz Jezierski - Tefnet
Dnia 2009-08-28, Pt o godzinie 18:29 -0400, Michael Bayer pisze: Tomasz Jezierski - Tefnet wrote: --- sqlalchemy.exc.ArgumentError: Column 'PhysObject.locationId' is not represented in mapper's table. Use the `column_property()` function to force this column to be mapped as a read-only

[sqlalchemy] Re: Problem with defining relations between inherited classes

2009-08-28 Thread Tefnet Developers
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:

[sqlalchemy] Re: Problem with defining relations between inherited classes

2009-08-28 Thread Michael Bayer
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

[sqlalchemy] Re: Problem with defining relations between inherited classes

2009-08-28 Thread Tomasz Jezierski - Tefnet
Dnia 2009-08-28, Pt o godzinie 10:51 -0400, Michael Bayer pisze: 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).

[sqlalchemy] Re: Problem with defining relations between inherited classes

2009-08-28 Thread Michael Bayer
Tomasz Jezierski - Tefnet wrote: Awkward column_property is because of exception you'll get if try to set Column without column_proprerty around it: --- sqlalchemy.exc.ArgumentError: Column 'PhysObject.locationId' is not represented in mapper's table. Use the `column_property()` function

[sqlalchemy] Re: Problem with defining relations between inherited classes

2009-08-28 Thread Michael Bayer
Tomasz Jezierski - Tefnet wrote: Awkward column_property is because of exception you'll get if try to set Column without column_proprerty around it: --- sqlalchemy.exc.ArgumentError: Column 'PhysObject.locationId' is not represented in mapper's table. Use the `column_property()` function to

[sqlalchemy] Re: Problem with defining relations between inherited classes

2009-08-28 Thread Michael Bayer
Tomasz Jezierski - Tefnet wrote: --- sqlalchemy.exc.ArgumentError: Column 'PhysObject.locationId' is not represented in mapper's table. Use the `column_property()` function to force this column to be mapped as a read-only attribute. ticket # 1523 has a patch that allows this approach to

[sqlalchemy] Re: Problem with defining relations between inherited classes

2009-08-27 Thread Michael Bayer
Tefnet Developers wrote: class Location(PhysObject): Id = sqlalchemy.Column(sqlalchemy.types.Integer, sqlalchemy.ForeignKey(PhysObject.Id), primary_key=True) description = sqlalchemy.Column( sqlalchemy.types.String(128)) PhysObject.location = sqlalchemy.orm.relation(