As I said in my first post, I understand that all three ways are correct. I
just wanted to know "the best", which means that it should always give the
same results and should not be deprecated in the future.
If I understand you correctly, "=None" is most recent implementation of "is
null" and (for
On Tue, Oct 20, 2009 at 9:51 PM, Michael P. Jung wrote:
>
> You're right in one thing. The whole foo=value thing is not documented.
>From the "exact" subsection in
http://docs.djangoproject.com/en/dev/topics/db/queries/#field-lookups
"""
For example, the following two
Михаил Лукин wrote:
> For some reason, __exact and __isnull are described in documentation
> [1], while =None is not. So which of them are historical?
Django pre 1.0 generated bogus SQL, when doing nullable_field=None.
These days __isnull can be replaced by the expressions:
On Tue, Oct 20, 2009 at 9:09 PM, Михаил Лукин
wrote:
> For some reason, __exact and __isnull are described in documentation [1],
> while =None is not. So which of them are historical?
As I said, __exact and __isnull are historical.
The documentation you reference
For some reason, __exact and __isnull are described in documentation [1],
while =None is not. So which of them are historical?
[1]
http://docs.djangoproject.com/en/dev/topics/db/queries/#topics-db-queries
2009/10/20 Russell Keith-Magee
>
> These three queries are all
On Tue, Oct 20, 2009 at 8:21 PM, Михаил Лукин
wrote:
> There is three ways to select NULL records from table with Django ORM:
>
> 1. Model.objects.filter(field=None)
> 2. Model.objects.filter(field__exact=None)
> 3. Model.objects.filter(field__isnull=True)
>
> They
There is three ways to select NULL records from table with Django ORM:
1. Model.objects.filter(field=None)
2. Model.objects.filter(field__exact=None)
3. Model.objects.filter(field__isnull=True)
They all seem to work.
Which is the best way and why?
--
regards,
Mihail
7 matches
Mail list logo