def render(self, context): object = template.resolve_variable(self.object_name, context) ctype_id, obj_id = get_target_for_object(object) t = get_template('rating/rating_form.html') c = context c.update({'ctype_id': ctype_id, 'obj_id': obj_id, 'object':object }) return t.render(c)
def get_for_object(self, object): ctype_id, obj_id = get_target_for_object(object) try: return self.get(content_type__pk=ctype_id, object_id=obj_id) except: return None
def render(self, context): object = template.resolve_variable(self.object_name, context) ctype_id, obj_id = get_target_for_object(object) t = get_template('rating/rating_form.html') c = context c.update({'ctype_id': ctype_id, 'obj_id': obj_id}) return t.render(c)