Re: [sqlalchemy] Replacing viewonly relationship properties in child classes

2014-04-13 Thread Konsta Vesterinen
Hi, thanks for quick reply Mike. Let's say the user has three models as defined in the SA joined table inheritance docs. Now the user applies versioning to these models. One way I could model these relationshi

Re: [sqlalchemy] Functional and declarative Index

2014-04-13 Thread Michael Bayer
you need to turn your __table_args__ into a callable: @declared_attr def __table_args__(cls): return (Index(..., func.lower(cls.name), ...), ) or just use a string for your functional index:Index(..., text("LOWER(name)"), ...) On Apr 13, 2014, at 9:22 PM, Joshua Ma wrote: > Is there

[sqlalchemy] Functional and declarative Index

2014-04-13 Thread Joshua Ma
Is there a way to create a functional index in a declarative model without referencing the actual column? I currently have something like class MyModel(db.Base): name = db.Column('name', db.String(255)) __table_args__ = ( Index('mymodel_lower_name_idx', func.lower(name),