#26634: Add the ability to do subselects for querying versioned data
--------------------------------+--------------------------------------
Reporter: dhobbs | Owner: nobody
Type: Uncategorized | Status: new
Component: Uncategorized | Version: 1.8
Severity: Normal | Resolution:
Keywords: QuerySet.extra | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
--------------------------------+--------------------------------------
Comment (by charettes):
If your database supports `DISTINCT ON` your could use:
{{{#!python
latest_project_versions = Project.objects.filter(
pk__in=Project.objects.order_by('ref', '-version').distinct('ref'),
)
}}}
I suppose this could be solved by
[https://github.com/django/django/pull/6478 the ungoing effort] to add
`SubQuery` support.
--
Ticket URL: <https://code.djangoproject.com/ticket/26634#comment:2>
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/064.d6b49357a53cfeba8fd387b54ffdb39b%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.