Re: [Sqlalchemy-tickets] [sqlalchemy] #2799: Declaring functional (func.lower) does not work as exp
Brought to you by:
zzzeek
|
From: sqlalchemy <mi...@zz...> - 2013-08-11 06:14:40
|
#2799: Declaring functional (func.lower) does not work as expected with
declarative
-----------------------------------+------------------------------------
Reporter: zejnzejn | Owner: zzzeek
Type: defect | Status: closed
Priority: medium | Milestone:
Component: cextensions | Severity: no triage selected yet
Resolution: worksforme | Keywords:
Progress State: completed/closed |
-----------------------------------+------------------------------------
Changes (by zzzeek):
* status: new => closed
* resolution: => worksforme
* status_field: awaiting triage => completed/closed
Comment:
the index needs to be associated with at least one column in the table.
The string "tag" is not a column, to SQLAlchemy its an arbitrary
expression. usage is as follows:
{{{
#!python
from sqlalchemy import *
from sqlalchemy.orm import *
from sqlalchemy.ext.declarative import declarative_base
Base = declarative_base()
class FuncIndex(Base):
__tablename__ = 'funcindex'
id = Column(Integer, primary_key=True)
tag = Column(String(20))
__table_args__ = (
Index('funcindex_idx', func.lower(tag)),
)
e = create_engine("postgresql://scott:tiger@localhost/test", echo=True)
Base.metadata.create_all(e)
}}}
--
Ticket URL: <http://www.sqlalchemy.org/trac/ticket/2799#comment:2>
sqlalchemy <http://www.sqlalchemy.org/>
The Database Toolkit for Python
|