app/projrev/views/helpers/templatetags/review_helpers.py
author Madhusudan.C.S <madhusudancs@gmail.com>
Mon, 10 Aug 2009 01:38:02 +0530
changeset 27 37612f295cd4
parent 26 97bd3c28c957
child 31 ef9fdc847543
permissions -rw-r--r--
Added comments for ranks and reviews.

"""A Django template tag library containing forms helpers.
"""

__authors__ = [
  '"Madhusudan.C.S" <madhusudancs@gmail.com>',
]


from django import template

register = template.Library()


@register.inclusion_tag('projrev/templatetags/_as_review.html')
def as_review(review):
  """Returns the comment contexts for the template tag.
  """

  total_score = (review.attribute1 + review.attribute2 + review.attribute3 + 
                 review.attribute4 + review.attribute5 + review.attribute6 +
                 review.attribute7 + review.attribute8 + review.attribute9)

  return {'review': review, 'total_score': total_score}