#25754: queryset.distinct('field') doesn't raise "DISTINCT ON not supported"
when
it should
----------------------------------------------+----------------------
Reporter: yoyoma | Owner: nobody
Type: Bug | Status: new
Component: Database layer (models, ORM) | Version: 1.8
Severity: Normal | Keywords: distinct
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 0 | UI/UX: 0
----------------------------------------------+----------------------
I'm running SQLite3 , and the following doesn't result in an error or any
visible output:
{{{
In [5]: Spam.objects.distinct('field')
Out[5]:
In [6]: isinstance(Spam.objects.distinct('field'), models.QuerySet)
Out[6]: True
}}}
The queryset is not evaluated for some reason.
{{{
In [7]: repr(Spam.objects.distinct('field'))
---------------------------------------------------------------------------
NotImplementedError Traceback (most recent call
last)
...
NotImplementedError: DISTINCT ON fields is not supported by this database
backend
}}}
Maybe this bug is really "queryset not evaluated when it should be",
rather than "doesn't raise an error when it should", since the following
is evaluated as expected:
{{{
In [8]: Spam.objects.all()
Out[8]: [<Spam: Salty>, <Spam: Delicious>, <Spam: Goo>]
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/25754>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" 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].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/049.2bd8bf4a733a15beb2ca300cade1ff05%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.