Opened 12 years ago
Closed 12 years ago
#19026 closed New feature (wontfix)
Meta: ordering randomly within groups
Reported by: | anonymous | Owned by: | nobody |
---|---|---|---|
Component: | Database layer (models, ORM) | Version: | 1.4 |
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
I'd like to do this on my model:
class Meta:
ordering = ['?tutor', 'title']
Indicating that results should be grouped by tutor, then sorted by title, but where the ordering of tutors should be random. I realise this is quite low priority and can probably be achieved in other ways, but is seems overkill to have to override the objects Manager class to achieve it.
Note:
See TracTickets
for help on using tickets.
Thanks for the suggestion, but there isn't likely to be a sane way to do something like this in the ORM. Managers are actually the perfect thing for defining such a narrow and specific behavior.