[sqlalchemy] How to properly declare a postgresql partial index?

2015-02-02 Thread Russ
What is the proper way to declare a postgresql partial index when using the @declared_attr decorator? This form gives me Cannot compile Column object until its 'name' is assigned: track_type = Column(SmallInteger, nullable = False) @declared_attr def __table_args__(cls):

Re: [sqlalchemy] How to properly declare a postgresql partial index?

2015-02-02 Thread Michael Bayer
Russ russandheat...@gmail.com wrote: I should have also indicated that the addition of sqlalchemy.sql.text fixes the small mixin example. The little script below works, but I don't know if it is a sketchy hack, or a safe long term solution: from sqlalchemy import * from sqlalchemy.orm

Re: [sqlalchemy] How to properly declare a postgresql partial index?

2015-02-02 Thread Russ
I should have also indicated that the addition of sqlalchemy.sql.text fixes the small mixin example. The little script below works, but I don't know if it is a sketchy hack, or a safe long term solution: from sqlalchemy import * from sqlalchemy.orm import * from sqlalchemy.ext.declarative

Re: [sqlalchemy] How to properly declare a postgresql partial index?

2015-02-02 Thread Michael Bayer
Russ russandheat...@gmail.com wrote: What is the proper way to declare a postgresql partial index when using the @declared_attr decorator? these two concepts aren’t really connected This form gives me Cannot compile Column object until its 'name' is assigned: track_type =

Re: [sqlalchemy] How to properly declare a postgresql partial index?

2015-02-02 Thread Russ
What is the proper way to declare a postgresql partial index when using the @declared_attr decorator? these two concepts aren’t really connected Sorry -- I described that poorly, then. However, I only see the problem (in v0.9.8) when I am using @declared_attr as in the case of a

Re: [sqlalchemy] How to properly declare a postgresql partial index?

2015-02-02 Thread Russ
Thanks. The name addition seems tidier to me so I switched to that for the moment. On a somewhat unrelated note, I love the what's new in 1.0 docs you linked. I had not checked them out yet. The Performance section is particularly awesome and well written. Aspects of it bring me back to