Code

Opened 3 years ago

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

Description

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 3 years ago.

Download all attachments as: .zip

Change History (4)

Changed 3 years ago by FunkyBob

comment:1 Changed 3 years ago by anonymous

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Triage Stage changed from Unreviewed to Design 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 3 years ago by julien

(That was me)

comment:3 Changed 3 years ago by SmileyChris

  • Resolution set to wontfix
  • Status changed from new to closed

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).

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.