We usually just handle this with a custom serializer (or form) field that 
converts all input to lowercase. That way we don't have to change any 
lookups or anything; all emails that come in to the system are already 
lowercase. Of course, that doesn't preserve what users enter but IME 
anything uppercase is just a fault of using the wrong text box on iOS or 
Android.



On Tuesday, November 24, 2015 at 5:33:54 AM UTC-6, Aymeric Augustin wrote:
>
> 2015-11-23 23:52 GMT+01:00 Carl Meyer <[email protected] <javascript:>>:
>
> I've implemented the CITEXT-based solution a couple times; I think for a
>> PostgreSQL-based project it's the preferable option overall.
>>
>
> Perhaps we should add native support in contrib.postgres?
>
> I'm forseeing a small difficulty in terms of API. This is a behavior I'd 
> like
> to "mix in" to some fields but I can't say if that will be easy to 
> implement.
>
> The general ideas would be:
>
> # A mixin
>
> class CITextField(TextField):
>     # ...
>
> # Case-insensitive versions of some built-in Django default fields
> # (if we consider that makes sense)
>
> class CIEmailField(CITextField, EmailField):
>     pass
>
> # The possibility for users to make custom fields case insensitive
>
> class CITagField(CITextField, TagField):
>     pass
>
> -- 
> Aymeric.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/72d064df-7599-4111-994a-d338dc81e7a3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to