#20837 closed Bug (invalid)

comments app template tags don't resolve context variables

Reported by: jaddison 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 Changed 21 months ago by jaddison

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset

Just a note: isn't this similar to the url vs url from future issue that required deprecation over 2 or 3 versions?

comment:2 Changed 21 months ago by CollinAnderson

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 Changed 21 months ago by timo

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

Correct, bugs for contrib.comments are no longer reported here.

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