Plan A:   On your DB use a case-insensitive collation order and make a 
unique index on it.

Plan B:  On your DB set up a trigger to save the data (eg lowercase) into a 
unique index field.

Plan C:  Similar to B,  but use 'compute' in web2py to update the field. 
 This is only good if the data will only be inserted/updated from within 
your web2py app.

Regards, D

On Wednesday, June 20, 2012 9:33:55 PM UTC+1, Corey Marques wrote:
>
> Howdy,
>
> I'm trying to put together a quick proof of concept to use this framework 
> for porting our desktop application to the web.
>
> I ran into an issue where unique fields don't follow our rules. In our 
> database the 'nickname' field is unique and "JOE" is the same as "joe".
>
> I did a quick search and couldn't find an elegant solution to this 
> problem. I was hoping for something like
>
> Field('nickname', unique_ignore_case=True)
>
> Is there a simple and efficient way to do this? The only solution I was 
> able to find involved duplicating the field on the table and saving both 
> the field and it's lowercase equivalent.  
>
> Thanks for your time.
>
> Corey.
>

-- 



Reply via email to