Ticket #5085: set-default-value-of-slug_field-to-slug.diff
File set-default-value-of-slug_field-to-slug.diff, 4.3 KB (added by , 17 years ago) |
---|
-
django/views/generic/date_based.py
286 286 287 287 def object_detail(request, year, month, day, queryset, date_field, 288 288 month_format='%b', day_format='%d', object_id=None, slug=None, 289 slug_field= None, template_name=None, template_name_field=None,289 slug_field='slug', template_name=None, template_name_field=None, 290 290 template_loader=loader, extra_context=None, context_processors=None, 291 291 template_object_name='object', mimetype=None, allow_future=False): 292 292 """ -
django/views/generic/list_detail.py
87 87 return HttpResponse(t.render(c), mimetype=mimetype) 88 88 89 89 def object_detail(request, queryset, object_id=None, slug=None, 90 slug_field= None, template_name=None, template_name_field=None,90 slug_field='slug', template_name=None, template_name_field=None, 91 91 template_loader=loader, extra_context=None, 92 92 context_processors=None, template_object_name='object', 93 93 mimetype=None): -
django/views/generic/create_update.py
71 71 return HttpResponse(t.render(c)) 72 72 73 73 def update_object(request, model, object_id=None, slug=None, 74 slug_field= None, template_name=None, template_loader=loader,74 slug_field='slug', template_name=None, template_loader=loader, 75 75 extra_context=None, post_save_redirect=None, 76 76 login_required=False, follow=None, context_processors=None, 77 77 template_object_name='object'): … … 146 146 return response 147 147 148 148 def delete_object(request, model, post_delete_redirect, 149 object_id=None, slug=None, slug_field= None, template_name=None,149 object_id=None, slug=None, slug_field='slug', template_name=None, 150 150 template_loader=loader, extra_context=None, 151 151 login_required=False, context_processors=None, template_object_name='object'): 152 152 """ -
docs/generic_views.txt
40 40 } 41 41 42 42 urlpatterns = patterns('django.views.generic.date_based', 43 (r'^(?P<year>\d{4})/(?P<month>[a-z]{3})/(?P<day>\w{1,2})/(?P<slug>[-\w]+)/$', 'object_detail', dict(info_dict, slug_field='slug')),43 (r'^(?P<year>\d{4})/(?P<month>[a-z]{3})/(?P<day>\w{1,2})/(?P<slug>[-\w]+)/$', 'object_detail', info_dict), 44 44 (r'^(?P<year>\d{4})/(?P<month>[a-z]{3})/(?P<day>\w{1,2})/$', 'archive_day', info_dict), 45 45 (r'^(?P<year>\d{4})/(?P<month>[a-z]{3})/$', 'archive_month', info_dict), 46 46 (r'^(?P<year>\d{4})/$', 'archive_year', info_dict), … … 603 603 604 604 Otherwise, ``slug`` should be the slug of the given object, and 605 605 ``slug_field`` should be the name of the slug field in the ``QuerySet``'s 606 model. 606 model. By default, ``slug_field`` is ``'slug'``. 607 607 608 608 **Optional arguments:** 609 609 … … 804 804 805 805 Otherwise, ``slug`` should be the slug of the given object, and 806 806 ``slug_field`` should be the name of the slug field in the ``QuerySet``'s 807 model. 807 model. By default, ``slug_field`` is ``'slug'``. 808 808 809 809 **Optional arguments:** 810 810 … … 948 948 949 949 Otherwise, ``slug`` should be the slug of the given object, and 950 950 ``slug_field`` should be the name of the slug field in the ``QuerySet``'s 951 model. 951 model. By default, ``slug_field`` is ``'slug'``. 952 952 953 953 **Optional arguments:** 954 954 … … 1033 1033 1034 1034 Otherwise, ``slug`` should be the slug of the given object, and 1035 1035 ``slug_field`` should be the name of the slug field in the ``QuerySet``'s 1036 model. 1036 model. By default, ``slug_field`` is ``'slug'``. 1037 1037 1038 1038 * ``post_delete_redirect``: A URL to which the view will redirect after 1039 1039 deleting the object.