def render(self, context): # resolv kwargs values items = self.kwargs.items() kwargs = dict([(key, value.resolve(context)) for key, value in items]) kwargs.update(self.blocks) ctype = self.get_target_ctype_pk(context, kwargs["name"]) qs = self.get_query_set(context, reviews.get_model(), ctype, kwargs["name"]) rs = self.render_tag(context, qs) return self.handle_result(context, kwargs, rs)
def confirmed(request): review = None if 'c' in request.GET: try: review = reviews.get_model().objects.get(pk=request.GET['c']) except (ObjectDoesNotExist, ValueError): pass return render_to_response(template, {'review': review}, context_instance=RequestContext(request) )
def render(self, context): # resolv kwargs values items = self.kwargs.items() kwargs = dict([(key, value.resolve(context)) for key, value in items]) kwargs.update(self.blocks) ctype = self.get_target_ctype_pk(context, kwargs["name"]) qs = self.get_query_set(context, reviews.get_model(), ctype, kwargs["name"]) template = [] if "with" in kwargs: template.append(kwargs["with"]) rs = self.render_tag(context, kwargs["name"], kwargs["category"], qs, template) return self.handle_result(context, kwargs, rs)
def testGetModel(self): from custom_reviews.models import CustomReview self.assertEqual(reviews.get_model(), CustomReview)