Ticket #6159: 00-admin-list-reusable-templatetags.diff

File 00-admin-list-reusable-templatetags.diff, 2.1 KB (added by Petr Marhoun <petr.marhoun@…>, 17 years ago)
  • django/contrib/admin/templatetags/admin_list.py

    === modified file 'django/contrib/admin/templatetags/admin_list.py'
     
    2323        return mark_safe(u'<span class="this-page">%d</span> ' % (i+1))
    2424    else:
    2525        return mark_safe(u'<a href="%s"%s>%d</a> ' % (cl.get_query_string({PAGE_VAR: i}), (i == cl.paginator.pages-1 and ' class="end"' or ''), i+1))
    26 paginator_number = register.simple_tag(paginator_number)
     26register.simple_tag(paginator_number)
    2727
    2828def pagination(cl):
    2929    paginator, page_num = cl.paginator, cl.page_num
     
    6666        'ALL_VAR': ALL_VAR,
    6767        '1': 1,
    6868    }
    69 pagination = register.inclusion_tag('admin/pagination.html')(pagination)
     69register.inclusion_tag('admin/pagination.html')(pagination)
    7070
    7171def result_headers(cl):
    7272    lookup_opts = cl.lookup_opts
     
    207207    return {'cl': cl,
    208208            'result_headers': list(result_headers(cl)),
    209209            'results': list(results(cl))}
    210 result_list = register.inclusion_tag("admin/change_list_results.html")(result_list)
     210register.inclusion_tag("admin/change_list_results.html")(result_list)
    211211
    212212def date_hierarchy(cl):
    213213    if cl.date_hierarchy:
     
    268268                    'title': year.year
    269269                } for year in years]
    270270            }
    271 date_hierarchy = register.inclusion_tag('admin/date_hierarchy.html')(date_hierarchy)
     271register.inclusion_tag('admin/date_hierarchy.html')(date_hierarchy)
    272272
    273273def search_form(cl):
    274274    return {
     
    276276        'show_result_count': cl.result_count != cl.full_result_count and not cl.opts.one_to_one_field,
    277277        'search_var': SEARCH_VAR
    278278    }
    279 search_form = register.inclusion_tag('admin/search_form.html')(search_form)
     279register.inclusion_tag('admin/search_form.html')(search_form)
    280280
    281281def admin_list_filter(cl, spec):
    282282    return {'title': spec.title(), 'choices' : list(spec.choices(cl))}
    283 admin_list_filter = register.inclusion_tag('admin/filter.html')(admin_list_filter)
     283register.inclusion_tag('admin/filter.html')(admin_list_filter)
Back to Top