-In a given list.
+In a given iterable.
Example::
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/28765>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* component: Database layer (models, ORM) => Documentation
* stage: Unreviewed => Accepted
Comment:
I'm not sure if "iterable" is the best term. For example, a string is
iterable but isn't accepted.
--
Ticket URL: <https://code.djangoproject.com/ticket/28765#comment:1>
Comment (by Дилян Палаузов):
String is accepted, at least with Postgresql. E.g. when a column consists
of a single letter {{{x = models.Char(max_char=1, default='A')}}} then
{{{...objects.filter(x__in='ABC')}}} is valid.
--
Ticket URL: <https://code.djangoproject.com/ticket/28765#comment:2>
Comment (by Tim Graham):
You're correct, but that generates `WHERE x IN (A, B, C)` which I don't
think is intuitive.
--
Ticket URL: <https://code.djangoproject.com/ticket/28765#comment:3>
Comment (by Дилян Палаузов):
The SQL generated is correct for the case. I find it also intuitive, as
this is also what I would have expected.
Back to he original question: are there any reason against clarifying that
the _in lookup accepts iterables of any kind, not just lists?
--
Ticket URL: <https://code.djangoproject.com/ticket/28765#comment:4>
* has_patch: 0 => 1
Comment:
[https://github.com/django/django/pull/9326 PR]
--
Ticket URL: <https://code.djangoproject.com/ticket/28765#comment:5>
* status: new => closed
* resolution: => fixed
Comment:
In [changeset:"5587485d49af8b32ab660854f751a234baa6610b" 5587485d]:
{{{
#!CommitTicketReference repository=""
revision="5587485d49af8b32ab660854f751a234baa6610b"
Fixed #28765 -- Clarified docs about what types the __in lookup accepts.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/28765#comment:6>
Comment (by Tim Graham <timograham@…>):
In [changeset:"bcaef2c91d234fe742973eb7df8a47f2048d3e63" bcaef2c9]:
{{{
#!CommitTicketReference repository=""
revision="bcaef2c91d234fe742973eb7df8a47f2048d3e63"
[2.0.x] Fixed #28765 -- Clarified docs about what types the __in lookup
accepts.
Backport of 5587485d49af8b32ab660854f751a234baa6610b from master
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/28765#comment:7>