Hi All,

I'm wondering if there's a reason why Index doesn't play the sames that ColumnCollectionConstraint does to allow columns names instead of column objects to be parsed?

Why? Well, 'cos I'd like to do:

from sqlalchemy import *

metadata = MetaData()

mytable = Table('user', metadata,
                Column('id', Integer, primary_key=True),
                Column('name', String(40)),
                UniqueConstraint('name'),
                Index('test','id','name')
                )

Er, okay, so why don't you just do:

mytable = Table('user', metadata,
                Column('id', Integer, primary_key=True),
                Column('name', String(40)),
                UniqueConstraint('name'),
                )
Index('test',mytable.c.id,mytzable.c.name)

Okay, I lied, I'm evil, what I really want to do is:

class Temporal(object):

    id =  Column(Integer, primary_key=True)
    ref =  Column(Integer ,index=True)
    value_from = Column(DateTime, nullable=False)
    value_to = Column(DateTime, nullable=True)
    __table_args__ = (
            Index('range','value_from','value_to'),
            )

...and then use that mixin all over the place ;-)

I'm happy to do the work, provided there's no reason why this would be insane / extremely hard to implement...

Chris

--
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalch...@googlegroups.com.
To unsubscribe from this group, send email to 
sqlalchemy+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en.

Reply via email to