OK you might have to use the DDL() construct instead, if Index doesn't  
support func() yet.


On Dec 10, 2008, at 2:19 AM, jose wrote:

>
> I tried it, as you suggested me, Michael...
>    Index('valuta_desc_uniq', func.lower(valuta.c.descrizione),  
> unique=True)
>
>  File "/usr/lib/python2.4/site-packages/sqlalchemy/schema.py", line
> 1045, in __init__
>    self._init_items(*columns)
>  File "/usr/lib/python2.4/site-packages/sqlalchemy/schema.py", line
> 1052, in _init_items
>    self.append_column(column)
>  File "/usr/lib/python2.4/site-packages/sqlalchemy/schema.py", line
> 1065, in append_column
>    self._set_parent(column.table)
> AttributeError: '_Function' object has no attribute 'table'
>
> Michael Bayer wrote:
>
>> I think this would involve sending func.lower(table.c.somecolumn) to
>> the Index construct.
>>
>>
>> On Dec 9, 2008, at 5:50 AM, jo wrote:
>>
>>
>>
>>> Maybe I'm using the 'case_sensitive' in a wrong way.
>>> Here what I want to reach :
>>>
>>> create unique index myname on mytable (lower(mycolumn));
>>>
>>> How can I create it on sqlalachemy?
>>>
>>> j
>>>
>>>
>>> Glauco ha scritto:
>>>
>>>
>>>> jo ha scritto:
>>>>
>>>>
>>>>
>>>>> Hi all,
>>>>>
>>>>> Trying to migrate from 0.3.10 to 0.5 I have this error:
>>>>>
>>>>> sqlalchemy.exc.ArgumentError: Unknown UniqueConstraint  
>>>>> argument(s):
>>>>> 'case_sensitive'
>>>>>
>>>>> how can I define the case_sensitive=True for a unique constraint?
>>>>>
>>>>> thank you,
>>>>> j
>>>>>
>>>>>
>>>>>
>>>>>
>>>> http://www.sqlalchemy.org/trac/browser/sqlalchemy/tags/rel_0_4_8/CHANGES
>>>>
>>>>
>>>> case_sensitive=(True|False) setting removed from schema items,  
>>>> since
>>>> checking this state added a lot of method call overhead and there
>>>> was no
>>>> decent reason to ever set it to False.  Table and column names
>>>> which are
>>>> all lower case will be treated as case-insenstive (yes we adjust  
>>>> for
>>>> Oracle's UPPERCASE style too).
>>>>
>>>>
>>>> Glauco
>>>>
>>>>
>>>>
>>>>
>>>
>>>
>>
>>
>>>
>>
>>
>>
>
>
> >


--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to