Django

Code

Changeset 5877

Show
Ignore:
Timestamp:
08/12/07 07:59:41 (1 year ago)
Author:
mtredinnick
Message:

Fixed #5085 -- In generic views, set the default name for the slug field to 'slug'. Thanks, Trevor Caira.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/trunk/AUTHORS

    r5874 r5877  
    6868    brut.alll@gmail.com 
    6969    Jonathan Buchanan <jonathan.buchanan@gmail.com> 
     70    Trevor Caira <trevor@caira.com> 
    7071    Ricardo Javier Cárdenes Medina <ricardo.cardenes@gmail.com> 
    7172    Antonio Cavedoni <http://cavedoni.com/> 
  • django/trunk/django/views/generic/create_update.py

    r5609 r5877  
    7272 
    7373def 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, 
    7575        extra_context=None, post_save_redirect=None, 
    7676        login_required=False, follow=None, context_processors=None, 
     
    147147 
    148148def 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, 
    150150        template_loader=loader, extra_context=None, 
    151151        login_required=False, context_processors=None, template_object_name='object'): 
  • django/trunk/django/views/generic/date_based.py

    r5511 r5877  
    287287def object_detail(request, year, month, day, queryset, date_field, 
    288288        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, 
    290290        template_loader=loader, extra_context=None, context_processors=None, 
    291291        template_object_name='object', mimetype=None, allow_future=False): 
  • django/trunk/django/views/generic/list_detail.py

    r5511 r5877  
    8888 
    8989def 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, 
    9191        template_loader=loader, extra_context=None, 
    9292        context_processors=None, template_object_name='object', 
  • django/trunk/docs/generic_views.txt

    r5537 r5877  
    4141 
    4242    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), 
    4444       (r'^(?P<year>\d{4})/(?P<month>[a-z]{3})/(?P<day>\w{1,2})/$',               'archive_day',   info_dict), 
    4545       (r'^(?P<year>\d{4})/(?P<month>[a-z]{3})/$',                                'archive_month', info_dict), 
     
    604604      Otherwise, ``slug`` should be the slug of the given object, and 
    605605      ``slug_field`` should be the name of the slug field in the ``QuerySet``'s 
    606       model. 
     606      model. By default, ``slug_field`` is ``'slug'``. 
    607607 
    608608**Optional arguments:** 
     
    805805      Otherwise, ``slug`` should be the slug of the given object, and 
    806806      ``slug_field`` should be the name of the slug field in the ``QuerySet``'s 
    807       model. 
     807      model. By default, ``slug_field`` is ``'slug'``. 
    808808 
    809809**Optional arguments:** 
     
    949949      Otherwise, ``slug`` should be the slug of the given object, and 
    950950      ``slug_field`` should be the name of the slug field in the ``QuerySet``'s 
    951       model. 
     951      model. By default, ``slug_field`` is ``'slug'``. 
    952952 
    953953**Optional arguments:** 
     
    10341034      Otherwise, ``slug`` should be the slug of the given object, and 
    10351035      ``slug_field`` should be the name of the slug field in the ``QuerySet``'s 
    1036       model. 
     1036      model. By default, ``slug_field`` is ``'slug'``. 
    10371037 
    10381038    * ``post_delete_redirect``: A URL to which the view will redirect after