[sqlalchemy] Re: Composite columns with declarative base

2008-11-05 Thread Ritesh Nadhani
I was not using declarative_base before. I used the normal method first encountered in the SQLAlchemy book. I tried the example in the book and applied to my problem and it worked. This is the first time, I am trying out with declarative base. I will now look into your script. On Tue, Nov 4, 200

[sqlalchemy] Re: Composite columns with declarative base

2008-11-04 Thread Michael Bayer
also, I wonder how the way you were doing it before, with composite, was actually working out ? It wasn't intended to hold "half" of a primary key like that which is probably why I warned against it, but if its working for you, there's no reason not to use it. I.e. with declarative just pu

[sqlalchemy] Re: Composite columns with declarative base

2008-11-04 Thread Michael Bayer
attached is a script illustrating the usage of comparable_property, in roughly the same way you were using composite earlier.from sqlalchemy import * from sqlalchemy.orm import * from sqlalchemy.orm.interfaces import PropComparator from sqlalchemy.ext.declarative import declarative_base engine = c

[sqlalchemy] Re: Composite columns with declarative base

2008-11-04 Thread Ritesh Nadhani
Unfortunately, it still gives me an error. http://paste.pocoo.org/show/90191 Did I miss something? PS: I added the __get__ method just for the fun of it, I have no idea what it does. Looking at the docs: http://www.sqlalchemy.org/docs/04/sqlalchemy_orm_interfaces.html#docstrings_sqlalchemy.orm.i

[sqlalchemy] Re: Composite columns with declarative base

2008-10-27 Thread Michael Bayer
theres a "bug" in that the error message is misleading, but in fact a composite property owns the columns within it which cannot be mapped separately, so to make that "work" you'd need to say: class User(Base): __tablename__ = 'user' house_address_id = Column('house_address', Int