Opened 11 years ago
Closed 11 years ago
#20837 closed Bug (invalid)
comments app template tags don't resolve context variables
Reported by: | James Addison | Owned by: | nobody |
---|---|---|---|
Component: | contrib.comments | Version: | 1.5 |
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
From the django comments app docs, you're able to specify the app.model and object_pk if you don't have an object in the template context, like this:
{% get_comment_list for blog.post object_pk as comment_list %}
However, I have a scenario where I want to pass in the app.model value in a context variable. eg. say I have a variable called object_content_type
containing 'blog.post', this errors out:
{% get_comment_list for object_content_type object_pk as comment_list %}
as does this:
{% get_comment_list for 'blog.post' object_pk as comment_list %}
Error info:
TemplateSyntaxError at /my-comments-page/
Third argument in u'get_comment_list' must be in the format 'app.model'
Near as I can figure it, the comments app template tags don't seem to attempt variable resolution of the token. Shouldn't it?
Change History (3)
comment:1 by , 11 years ago
comment:2 by , 11 years ago
I'm not a core developer, but as far as I can tell, everything you have reported is correct and probably a good idea.
However, the entire comments app is deprecated and has been pulled out to a separate project. I suggest proposing this idea there instead.
https://github.com/django/django-contrib-comments
More info about the deprecation here:
https://docs.djangoproject.com/en/dev/ref/contrib/comments/
comment:3 by , 11 years ago
Resolution: | → invalid |
---|---|
Status: | new → closed |
Correct, bugs for contrib.comments
are no longer reported here.
Just a note: isn't this similar to the
url
vsurl from future
issue that required deprecation over 2 or 3 versions?