Opened 8 years ago

Closed 8 years ago

#16296 closed New feature (wontfix)

django.contrib.comments could offer a config option for default order

Reported by: FunkyBob Owned by: FunkyBob
Component: contrib.comments Version: 1.3
Severity: Normal Keywords: comments
Cc: Triage Stage: Design decision needed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no


By default, comments are ordered by oldest-post-first, except in Feed, where it's newest first.

Whilst it's possible to change this by replacing the comment model with your own, this seems a little excessive when a single setting (say, COMMENTS_ORDER ) could make it trivial to change.

The attached patch allows you to either specify 'reverse', which uses ('-submit_date'), or supply your own list/tuple of sorting.

Attachments (1)

comment_order.patch (777 bytes) - added by FunkyBob 8 years ago.

Download all attachments as: .zip

Change History (4)

Changed 8 years ago by FunkyBob

Attachment: comment_order.patch added

comment:1 Changed 8 years ago by anonymous

Triage Stage: UnreviewedDesign decision needed

contrib.comments is already a bit bloated and I'd be wary of adding more settings, especially considering the fact that it already is possible to have entirely customised comment models.

Your proposal is not acceptable as-is because there would be a confusion from a developer's perspective as to what the setting applies to (i.e. to the default ordering, to the feeds, or both?). I also think that accepting 'reverse' isn't ideal -- if anything, you'd only allow to provide an explicit list/tuple of fields.

Marking as DDN for now to leave a chance for a nice API to be proposed. If no clean API can emerge, then this would be a wontfix.

comment:2 Changed 8 years ago by Julien Phalip

(That was me)

comment:3 Changed 8 years ago by Chris Beaven

Resolution: wontfix
Status: newclosed

Yeah, I'm not convinced the use-case is common enough to justify another settingTM.

As already pointed out, it's already possible (a proxy model of contrib.comments.models.Comment on your own comments app if that's all you want).

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