Thursday, January 23, 2020

Re: Case-insensitve unique = True

I wonder at that.  When I develop a model does the CharField have to be specified case insensitive at that level.

For instance :  A search can be case insensitive and iexact is the best way.
 
               
 


On Fri, Jan 24, 2020 at 8:06 AM Mike Dewhirst <miked@dewhirst.com.au> wrote:
What is the best way to ensure a charfield is case-insensitively unique?

Currently I'm using a query with __iexact=True but I wonder whether
there is a better way.

Thanks

Mike


--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/49ae5424-f079-d4eb-bc6d-aa5231efa773%40dewhirst.com.au.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CABOHK3RTRmRwyMsgdryp50vVbBeopqBcu2CCQdrY9aJySjwkpg%40mail.gmail.com.

No comments:

Post a Comment