Ticket #1041: generic.patch

File generic.patch, 5.6 KB (added by ian@…, 19 years ago)

switch to new version of template-loader

  • date_based.py

     
    1 from django.core import template_loader
     1from django.core.template import loader
    22from django.core.exceptions import Http404, ObjectDoesNotExist
    33from django.core.extensions import DjangoContext as Context
    44from django.core.xheaders import populate_xheaders
     
    77import datetime, time
    88
    99def 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,
    1111                  extra_lookup_kwargs={}, extra_context={}, allow_empty=False):
    1212    """
    1313    Generic top-level archive of date-based objects.
     
    5050    return HttpResponse(t.render(c))
    5151
    5252def 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,
    5454                 extra_lookup_kwargs={}, extra_context={}):
    5555    """
    5656    Generic yearly archive view.
     
    8787    return HttpResponse(t.render(c))
    8888
    8989def 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,
    9191                  extra_lookup_kwargs={}, extra_context={}):
    9292    """
    9393    Generic monthly archive view.
     
    136136
    137137def archive_day(request, year, month, day, app_label, module_name, date_field,
    138138                month_format='%b', day_format='%d', template_name=None,
    139                 template_loader=template_loader, extra_lookup_kwargs={},
     139                template_loader=loader, extra_lookup_kwargs={},
    140140                extra_context={}, allow_empty=False):
    141141    """
    142142    Generic daily archive view.
     
    200200def object_detail(request, year, month, day, app_label, module_name, date_field,
    201201                  month_format='%b', day_format='%d', object_id=None, slug=None,
    202202                  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={},
    204204                  extra_context={}):
    205205    """
    206206    Generic detail view from year/month/day/slug or year/month/day/id structure.
  • list_detail.py

     
    11from django import models
    2 from django.core import template_loader
     2from django.core.template import loader
    33from django.utils.httpwrappers import HttpResponse
    44from django.core.xheaders import populate_xheaders
    55from django.core.extensions import DjangoContext as Context
     
    77from django.core.exceptions import Http404, ObjectDoesNotExist
    88
    99def 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,
    1111                extra_lookup_kwargs={}, extra_context={}):
    1212    """
    1313    Generic list of objects.
     
    8080
    8181def object_detail(request, app_label, module_name, object_id=None, slug=None,
    8282                  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={},
    8484                  extra_context={}):
    8585    """
    8686    Generic list of objects.
  • create_update.py

     
    11from django import models
    22from django.core.xheaders import populate_xheaders
    3 from django.core import template_loader, formfields, meta
     3from django.core.template import loader
     4from django.core import formfields, meta
    45from django.views.auth.login import redirect_to_login
    56from django.core.extensions import DjangoContext as Context
    67from django.core.paginator import ObjectPaginator, InvalidPage
     
    89from django.core.exceptions import Http404, ObjectDoesNotExist, ImproperlyConfigured
    910
    1011def create_object(request, app_label, module_name, template_name=None,
    11                  template_loader=template_loader, extra_context={},
     12                 template_loader=loader, extra_context={},
    1213                 post_save_redirect=None, login_required=False, follow=None):
    1314    """
    1415    Generic object-creation function.
     
    7071    return HttpResponse(t.render(c))
    7172
    7273def 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,
    7475                  extra_lookup_kwargs={}, extra_context={}, post_save_redirect=None,
    7576                  login_required=False, follow=None):
    7677    """
     
    145146
    146147def delete_object(request, app_label, module_name, post_delete_redirect,
    147148                  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={},
    149150                  extra_context={}, login_required=False):
    150151    """
    151152    Generic object-delete function.
Back to Top