Hello,

I’m not a fan of having every project that needs case-insensitive fields 
declare:

class CICharField(CIText, CharField):
    pass

class CITextField(CIText, TextField):
    pass

class CIEmailField(CIText, EmailField):
    pass

Could Django take care of providing these classes? (And perhaps other useful 
ones?)

Best regards,

-- 
Aymeric.



> On 9 Feb 2017, at 14:33, Tim Graham <timogra...@gmail.com> wrote:
> 
> That looks good to me.
> 
> On Thursday, February 9, 2017 at 4:58:16 AM UTC-5, Mads Jensen wrote:
> I had the use case for shorter text strings in mind when I did the PR.
> 
> https://github.com/atombrella/django/commit/ae8fe50f34329cbc969c5ac5bd368efd5b42b177
>  
> <https://github.com/atombrella/django/commit/ae8fe50f34329cbc969c5ac5bd368efd5b42b177>
>  <- would this be a better approach?
> 
> On Wednesday, February 8, 2017 at 6:09:26 PM UTC+1, Tim Graham wrote:
> I thought the mixin idea was good but everyone else (including Aymeric) 
> reviewed the pull request and ignored your comment about that so I assumed no 
> one else saw its merits. Considering a CITextField that uses CharField still 
> has some usefulness as you mentioned, I'm in favor of CITextField not 
> inheriting anything and requiring its use as a mixin -- unless there are some 
> unforeseen problems with that.
> 
> On Wednesday, February 8, 2017 at 11:55:50 AM UTC-5, Jon Dufresne wrote:
> > Does it make sense to add a CICharField for these cases or you can just 
> > override the form/admin.
> 
> In a past Django developers discussion, Aymeric suggested building this 
> functionality with a mixin so the citext type could apply to multiple DB 
> fields which would then affect how the form field is rendered. Personally, I 
> like this idea and believe it would provide the most flexibility such that a 
> TextField, CharField, EmailField, etc. could all be backed by the citext type.
> 
> https://groups.google.com/d/msg/django-developers/SW7_qI81G58/i6aJVRnJBAAJ 
> <https://groups.google.com/d/msg/django-developers/SW7_qI81G58/i6aJVRnJBAAJ>
> 
> From Aymeric in the previous thread:
> 
> ---
> 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
> ---
> 
> -- 
> 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 django-developers+unsubscr...@googlegroups.com 
> <mailto:django-developers+unsubscr...@googlegroups.com>.
> To post to this group, send email to django-developers@googlegroups.com 
> <mailto:django-developers@googlegroups.com>.
> Visit this group at https://groups.google.com/group/django-developers 
> <https://groups.google.com/group/django-developers>.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-developers/827e4af1-2431-4216-95e2-0e72afe0ce70%40googlegroups.com
>  
> <https://groups.google.com/d/msgid/django-developers/827e4af1-2431-4216-95e2-0e72afe0ce70%40googlegroups.com?utm_medium=email&utm_source=footer>.
> For more options, visit https://groups.google.com/d/optout 
> <https://groups.google.com/d/optout>.

-- 
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 django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/79B14592-6C40-46AB-94AB-638EF2D378DE%40polytechnique.org.
For more options, visit https://groups.google.com/d/optout.

Reply via email to