This works as you would expect for SELECT and INSERT.
It would be great to have equivalents to the CIText fields in
postgres.contrib - this would make it a lot easier to unit test code using
those fields.
--
Ticket URL: <https://code.djangoproject.com/ticket/30248>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* status: new => closed
* resolution: => needsinfo
* version: 2.1 => master
* component: Uncategorized => Database layer (models, ORM)
Comment:
Hi Stuart.
Short answer, "Yes, maybe". :)
First off would be proof-of-concept fields, maybe in a third-party
(similar to exist for MySQL and Postgres already). The `CIText` fields are
fairly minimal, so there may not be much here.
Then an approach to the DevelopersMailingList to see if there were
appetite to include such fields in Django itself. (At that point I'm
wondering if similar isn't supported across all four supported backends,
in which case would we want to pull the fields out of `contrib`...?) — The
issue tracker isn't really the best place for that conversation.
--
Ticket URL: <https://code.djangoproject.com/ticket/30248#comment:1>
Comment (by Nick Pope):
Replying to [comment:1 Carlton Gibson]:
> At that point I'm wondering if similar isn't supported across all four
supported backends, in which case would we want to pull the fields out of
`contrib`...?
If this is possible, it would then make sense to implement
{{{CharField(insensitive=True)}}}, with default of {{{False}}}. Perhaps
this could also work with {{{TextField}}}?
--
Ticket URL: <https://code.djangoproject.com/ticket/30248#comment:2>
Comment (by Carlton Gibson):
Hey Nick.
> If this is possible...
Oh, good idea.
If someone wants to tell me that this is on, happy to see this moved into
the Accepted pile.
(Not sure what thoughts on a `contrib.sqlite` would be if not... —
probably leaning towards third-party I'd guess.)
--
Ticket URL: <https://code.djangoproject.com/ticket/30248#comment:3>
Old description:
> Sqlite supports case insensitive fields by setting COLLATE NOCASE.
>
> This works as you would expect for SELECT and INSERT.
>
> It would be great to have equivalents to the CIText fields in
> postgres.contrib - this would make it a lot easier to unit test code
> using those fields.
New description:
--
Comment (by Stuart Axon):
Cheers, I did send an initial mail to the dev list, but think it might
have got eaten as I didn't see it (also had a bit of bad luck updating
this ticket, updating the description, not leaving a comment).
One thing I found out, is that even with COLLATE NOCASE sqlites regexes
don't default to case insensitive, so that would need some support at the
django end.
I had a bit of a look into how the postgres citext works, but couldn't
work out how to make Operators that integrate with Django in the same way.
I guess a really tiny implementation, as fields.py might be a start ?
--
Ticket URL: <https://code.djangoproject.com/ticket/30248#comment:4>