Opened 13 years ago
Closed 12 years ago
#16524 closed New feature (wontfix)
Add a manager/queryset method in contrib.comments to fetch comments not in moderation
Reported by: | Mathieu Pillard | Owned by: | Justin Lilly |
---|---|---|---|
Component: | contrib.comments | Version: | dev |
Severity: | Normal | Keywords: | |
Cc: | Triage Stage: | Accepted | |
Has patch: | yes | Needs documentation: | yes |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
django.contrib.comments has a query to fetch all comments that are not in moderation, i.e. all the "publicly viewable" comments.
It's hidden inside the BaseCommentNode class in templatetags/comments though, which means developers using django.contrib.comments wanting to fetch publicly viewable comments outside of a templatetag context must violate DRY and copy/paste the filters themselves.
Attached is a patch that moves this code to a manager/queryset method, and that pass all current tests. It also makes possible to use the other manager methods (in_moderation, for_model) as queryset methods.
Attachments (2)
Change History (9)
by , 13 years ago
Attachment: | comments-add-queryset-methods.diff added |
---|
comment:1 by , 13 years ago
Has patch: | set |
---|
comment:2 by , 13 years ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
Triage Stage: | Unreviewed → Ready for checkin |
comment:3 by , 13 years ago
Needs documentation: | set |
---|---|
Needs tests: | set |
Triage Stage: | Ready for checkin → Accepted |
Type: | Uncategorized → New feature |
Please also attach an up-to-date patch with your changes. Also needs docs and tests.
comment:4 by , 13 years ago
Sadly, I currently lack the time to finish/improve my patch. If someone wants to work on this, feel free!
by , 13 years ago
Attachment: | 16524.diff added |
---|
comment:5 by , 13 years ago
Needs documentation: | unset |
---|---|
Needs tests: | unset |
Owner: | changed from | to
Status: | assigned → new |
Most of the tests for comment managers still apply here. The current documentation still applies. If you can make a more targeted suggestion for which docs to provide, I'll happily add them, but I think the current document is adequate.
comment:6 by , 13 years ago
Needs documentation: | set |
---|
You add several model manager methods which simply need to be documented to be of any use.
comment:7 by , 12 years ago
Resolution: | → wontfix |
---|---|
Status: | new → closed |
django.contrib.comments
has been deprecated and is no longer supported, so I'm closing this ticket. We're encouraging users to transition to a custom solution, or to a hosted solution like Disqus.
The code itself has moved to https://github.com/django/django-contrib-comments; if you want to keep using it, you could move this bug over there.
https://github.com/django/django/pull/31
Added a pull request.
@mat, in the future, your diffs should be relative to the repository root (ie: the folder with a django and tests folder in it).