My favorites | Sign in
Project Home Wiki Issues Source
New issue   Search
for
  Advanced search   Search tips   Subscriptions
Issue 1: do_reviews_for_object template tag
1 person starred this issue and may be notified of changes. Back to list
Status:  New
Owner:  ----


Sign in to add a comment
 
Reported by nikola...@gmail.com, Oct 29, 2009
to activate this tag you need change class ReviewsForObjectNode(Node) into
this:

class ReviewsForObjectNode(Node):
    def __init__(self, obj, context_var):
        self.obj = Variable(obj)
        self.context_var = context_var

    def render(self, context):
        ctp = ContentType.objects.get_for_model(self.obj.resolve(context))
        context[self.context_var] = \
           
Review.objects.filter(content_type__pk=ctp.id,object_pk=self.obj.resolve(context).id)
        return ''


and after that register new tag

register.tag(do_reviews_for_object)

Sign in to add a comment

Powered by Google Project Hosting