Beispiel #1
0
 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)
Beispiel #2
0
 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
Beispiel #3
0
 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)
Beispiel #4
0
 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