Ticket #15287: patch.diff
File patch.diff, 4.3 KB (added by , 14 years ago) |
---|
-
django/views/generic/date_based.py
34 34 queryset = queryset.filter(**{'%s__lte' % date_field: datetime.datetime.now()}) 35 35 date_list = queryset.dates(date_field, 'year')[::-1] 36 36 if not date_list and not allow_empty: 37 raise Http404("No %s available" % model._meta. verbose_name)37 raise Http404("No %s available" % model._meta.object_name) 38 38 39 39 if date_list and num_latest: 40 40 latest = queryset.order_by('-'+date_field)[:num_latest] … … 354 354 try: 355 355 obj = queryset.get(**lookup_kwargs) 356 356 except ObjectDoesNotExist: 357 raise Http404("No %s found for" % model._meta. verbose_name)357 raise Http404("No %s found for" % model._meta.object_name) 358 358 if not template_name: 359 359 template_name = "%s/%s_detail.html" % (model._meta.app_label, model._meta.object_name.lower()) 360 360 if template_name_field: -
django/views/generic/list_detail.py
131 131 try: 132 132 obj = queryset.get() 133 133 except ObjectDoesNotExist: 134 raise Http404("No %s found matching the query" % (model._meta. verbose_name))134 raise Http404("No %s found matching the query" % (model._meta.object_name)) 135 135 if not template_name: 136 136 template_name = "%s/%s_detail.html" % (model._meta.app_label, model._meta.object_name.lower()) 137 137 if template_name_field: -
django/views/generic/dates.py
194 194 qs = qs.filter(**{'%s__lte' % date_field: datetime.datetime.now()}) 195 195 196 196 if not allow_empty and not qs: 197 raise Http404(u"No %s available" % unicode(qs.model._meta.verbose_name_plural))197 raise Http404(u"No %s list available" % unicode(qs.model._meta.object_name)) 198 198 199 199 return qs 200 200 … … 208 208 209 209 date_list = queryset.dates(date_field, date_type)[::-1] 210 210 if date_list is not None and not date_list and not allow_empty: 211 raise Http404(u"No %s available" % unicode(qs.model._meta.verbose_name_plural))211 raise Http404(u"No %s list available" % unicode(qs.model._meta.object_name)) 212 212 213 213 return date_list 214 214 … … 458 458 qs = self.get_queryset() 459 459 460 460 if not self.get_allow_future() and date > datetime.date.today(): 461 raise Http404("Future %s not available because %s.allow_future is False." % (462 qs.model._meta. verbose_name_plural, self.__class__.__name__)461 raise Http404("Future %s list is not available because %s.allow_future is False." % ( 462 qs.model._meta.object_name, self.__class__.__name__) 463 463 ) 464 464 465 465 # Filter down a queryset from self.queryset using the date from the -
django/views/generic/detail.py
48 48 obj = queryset.get() 49 49 except ObjectDoesNotExist: 50 50 raise Http404(u"No %s found matching the query" % 51 (queryset.model._meta. verbose_name))51 (queryset.model._meta.object_name)) 52 52 return obj 53 53 54 54 def get_queryset(self): -
django/views/generic/create_update.py
95 95 return model.objects.get(**lookup_kwargs) 96 96 except ObjectDoesNotExist: 97 97 raise Http404("No %s found for %s" 98 % (model._meta. verbose_name, lookup_kwargs))98 % (model._meta.object_name, lookup_kwargs)) 99 99 100 100 def create_object(request, model=None, template_name=None, 101 101 template_loader=loader, extra_context=None, post_save_redirect=None,