On May 24, 3:10 pm, Michael Bayer <[EMAIL PROTECTED]> wrote:
> uh well lets look at the source code. Column.unique *is* assigned if
> you send the "unique" keyword argument. it transforms the unique
> keyword argument into a UniqueConstraint when the Column is assigned
> to its Table via _set_parent.
I tested that... I tried setting unique=True in individual Column
definitions within a Table definition and upon creating the table, the
Column.unique property on those columns still showed up as None. I'll
go and see if I can replicate this.
> so id argue for removing the "unique" attribute from Column
> altogether, even though its a constructor argument, since its just a
> shortcut to adding records to the Table's list of constraints and
> does not accurately reflect the "unique" status of the column in many
> cases. a better accessor would be a collection of UniqueConstraints
> which happen to reference the column, and that accessor would just do
> the work youre already doing when called (i.e. loop thru the table's
> constraints and match).
I agree, that would be just right.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"sqlalchemy" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---