Ticket #1041: generic.patch
File generic.patch, 5.6 KB (added by , 19 years ago) |
---|
-
date_based.py
1 from django.core import template_loader1 from django.core.template import loader 2 2 from django.core.exceptions import Http404, ObjectDoesNotExist 3 3 from django.core.extensions import DjangoContext as Context 4 4 from django.core.xheaders import populate_xheaders … … 7 7 import datetime, time 8 8 9 9 def archive_index(request, app_label, module_name, date_field, num_latest=15, 10 template_name=None, template_loader= template_loader,10 template_name=None, template_loader=loader, 11 11 extra_lookup_kwargs={}, extra_context={}, allow_empty=False): 12 12 """ 13 13 Generic top-level archive of date-based objects. … … 50 50 return HttpResponse(t.render(c)) 51 51 52 52 def archive_year(request, year, app_label, module_name, date_field, 53 template_name=None, template_loader= template_loader,53 template_name=None, template_loader=loader, 54 54 extra_lookup_kwargs={}, extra_context={}): 55 55 """ 56 56 Generic yearly archive view. … … 87 87 return HttpResponse(t.render(c)) 88 88 89 89 def archive_month(request, year, month, app_label, module_name, date_field, 90 month_format='%b', template_name=None, template_loader= template_loader,90 month_format='%b', template_name=None, template_loader=loader, 91 91 extra_lookup_kwargs={}, extra_context={}): 92 92 """ 93 93 Generic monthly archive view. … … 136 136 137 137 def archive_day(request, year, month, day, app_label, module_name, date_field, 138 138 month_format='%b', day_format='%d', template_name=None, 139 template_loader= template_loader, extra_lookup_kwargs={},139 template_loader=loader, extra_lookup_kwargs={}, 140 140 extra_context={}, allow_empty=False): 141 141 """ 142 142 Generic daily archive view. … … 200 200 def object_detail(request, year, month, day, app_label, module_name, date_field, 201 201 month_format='%b', day_format='%d', object_id=None, slug=None, 202 202 slug_field=None, template_name=None, template_name_field=None, 203 template_loader= template_loader, extra_lookup_kwargs={},203 template_loader=loader, extra_lookup_kwargs={}, 204 204 extra_context={}): 205 205 """ 206 206 Generic detail view from year/month/day/slug or year/month/day/id structure. -
list_detail.py
1 1 from django import models 2 from django.core import template_loader2 from django.core.template import loader 3 3 from django.utils.httpwrappers import HttpResponse 4 4 from django.core.xheaders import populate_xheaders 5 5 from django.core.extensions import DjangoContext as Context … … 7 7 from django.core.exceptions import Http404, ObjectDoesNotExist 8 8 9 9 def object_list(request, app_label, module_name, paginate_by=None, allow_empty=False, 10 template_name=None, template_loader= template_loader,10 template_name=None, template_loader=loader, 11 11 extra_lookup_kwargs={}, extra_context={}): 12 12 """ 13 13 Generic list of objects. … … 80 80 81 81 def object_detail(request, app_label, module_name, object_id=None, slug=None, 82 82 slug_field=None, template_name=None, template_name_field=None, 83 template_loader= template_loader, extra_lookup_kwargs={},83 template_loader=loader, extra_lookup_kwargs={}, 84 84 extra_context={}): 85 85 """ 86 86 Generic list of objects. -
create_update.py
1 1 from django import models 2 2 from django.core.xheaders import populate_xheaders 3 from django.core import template_loader, formfields, meta 3 from django.core.template import loader 4 from django.core import formfields, meta 4 5 from django.views.auth.login import redirect_to_login 5 6 from django.core.extensions import DjangoContext as Context 6 7 from django.core.paginator import ObjectPaginator, InvalidPage … … 8 9 from django.core.exceptions import Http404, ObjectDoesNotExist, ImproperlyConfigured 9 10 10 11 def create_object(request, app_label, module_name, template_name=None, 11 template_loader= template_loader, extra_context={},12 template_loader=loader, extra_context={}, 12 13 post_save_redirect=None, login_required=False, follow=None): 13 14 """ 14 15 Generic object-creation function. … … 70 71 return HttpResponse(t.render(c)) 71 72 72 73 def update_object(request, app_label, module_name, object_id=None, slug=None, 73 slug_field=None, template_name=None, template_loader= template_loader,74 slug_field=None, template_name=None, template_loader=loader, 74 75 extra_lookup_kwargs={}, extra_context={}, post_save_redirect=None, 75 76 login_required=False, follow=None): 76 77 """ … … 145 146 146 147 def delete_object(request, app_label, module_name, post_delete_redirect, 147 148 object_id=None, slug=None, slug_field=None, template_name=None, 148 template_loader= template_loader, extra_lookup_kwargs={},149 template_loader=loader, extra_lookup_kwargs={}, 149 150 extra_context={}, login_required=False): 150 151 """ 151 152 Generic object-delete function.