def render(self, context): try: object = template.resolve_variable(self.object, context) except template.VariableDoesNotExist: return '' context[self.context_var] = ViewTracker.get_views_for(object) return ''
def render(self, context): try: object = template.resolve_variable(self.object, context) except template.VariableDoesNotExist: return '' context[self.context_var] = ViewTracker.get_views_for(object) return ''
def view_count(self): """ From django-popularity, get the view count for the object. This is used to sort objects in a list view. """ return ViewTracker.get_views_for(self)
def view_count(self): """ From django-popularity, get the view count for the object. This is used to sort objects in a list view. """ return ViewTracker.get_views_for(self)