在SQLAlchemy的0.5定義列的一部分作爲一個獨特的領域我已經定義了這樣一個表格:在SQLAlchemy的
orders = Table('orders', metadata,
Column('id', Integer, primary_key=True),
Column('responsable', String(255)),
Column('customer', String(255)),
Column('progressive', Integer),
Column('date', Date),
Column('exported', Boolean()),
)
是否有可能只定義日期爲唯一的客戶和年份? 年份不僅僅是一個日期的一部分,但它可以很好地讓日期和客戶的年份成爲表格的單個關鍵字。 sqlalchemy 0.5有可能嗎?
由於
你的問題混淆了索引的唯一性(主鍵所需)。 – msw 2010-06-20 20:54:52