Opened 10 years ago
Last modified 10 years ago
#24004 closed Bug
Can't use only() with latest() if x is in only() and get_latest_by — at Version 1
Reported by: | Tom Carrick | Owned by: | nobody |
---|---|---|---|
Component: | Database layer (models, ORM) | Version: | 1.7 |
Severity: | Normal | Keywords: | |
Cc: | Triage Stage: | Unreviewed | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description (last modified by )
model Page(models.Model): ... last_modified = models.Datefield() class Meta: get_latest_by = 'last_modified'
Suppose I want to get the date of the last modification, I might do something like this:
Page.objects.only('last_modified').latest()
But on trying it, we seem to get stuck copying something until we reach maximum recursion depth.
I don't know if this is a bug or if it's simply not going to work, but if it's the latter, I think it could be documented somewhere.
Note:
See TracTickets
for help on using tickets.