#17813: Implement an opposite method for Entry.objects.latest -------------------------------------+------------------------------------- Reporter: tonnzor | Owner: nobody Type: New feature | Status: closed Component: Database layer | Version: SVN (models, ORM) | Resolution: fixed Severity: Normal | Triage Stage: Accepted Keywords: | Needs documentation: 1 Has patch: 1 | Patch needs improvement: 0 Needs tests: 0 | UI/UX: 0 Easy pickings: 1 | -------------------------------------+------------------------------------- Changes (by jimmysong):
* status: new => closed * resolution: => fixed * needs_tests: 1 => 0 Comment: First open source contribution here, FYI. I've added a test for the first method and added a first method to the model manager. The tests pass. There is one thing in the patch that's inconsistent and that's the get_latest_by from the _meta. It seems too hackish to leave that as the default for the first as well. I would like some direction as to how to how to solve this dilemma. Creating a corresponding get_first_by seems really odd as Entry.objects.first() would use a completely different criteria as Entry.objects.latest(). Creating a more general thing to apply to first or latest is a naming nightmare and get_first_or_latest_by is neither backwards-compatible nor easy to remember. Can someone give me some direction on this? -- Ticket URL: <https://code.djangoproject.com/ticket/17813#comment:3> 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 post to this group, send email to django-updates@googlegroups.com. To unsubscribe from this group, send email to django-updates+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-updates?hl=en.