Opened 3 years ago

Closed 3 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


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.

Change History (1)

comment:1 Changed 3 years ago by ptone

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Resolution set to wontfix
  • Status changed from new to closed

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.

Note: See TracTickets for help on using tickets.
Back to Top