From 2483ed749bc0969b38ddf27a84c01ad6af628647 Mon Sep 17 00:00:00 2001 From: Adrian Holovaty Date: Thu, 19 Jan 2006 03:29:45 +0000 Subject: [PATCH] Removed commented-out decorator syntax in admin template tags. It was looking a bit messy. git-svn-id: http://code.djangoproject.com/svn/django/trunk@2068 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- django/contrib/admin/templatetags/admin_list.py | 7 ------- django/contrib/admin/templatetags/admin_modify.py | 9 --------- django/contrib/admin/templatetags/adminmedia.py | 2 +- 3 files changed, 1 insertion(+), 17 deletions(-) diff --git a/django/contrib/admin/templatetags/admin_list.py b/django/contrib/admin/templatetags/admin_list.py index beb9f7f4d0..af77d762d2 100644 --- a/django/contrib/admin/templatetags/admin_list.py +++ b/django/contrib/admin/templatetags/admin_list.py @@ -14,7 +14,6 @@ register = Library() DOT = '.' -#@register.simple_tag def paginator_number(cl,i): if i == DOT: return '... ' @@ -24,7 +23,6 @@ def paginator_number(cl,i): return '%d ' % (cl.get_query_string({PAGE_VAR: i}), (i == cl.paginator.pages-1 and ' class="end"' or ''), i+1) paginator_number = register.simple_tag(paginator_number) -#@register.inclusion_tag('admin/pagination') def pagination(cl): paginator, page_num = cl.paginator, cl.page_num @@ -179,7 +177,6 @@ def results(cl): for res in cl.result_list: yield list(items_for_result(cl,res)) -#@register.inclusion_tag("admin/change_list_results") def result_list(cl): res = list(results(cl)) return {'cl': cl, @@ -187,7 +184,6 @@ def result_list(cl): 'results': list(results(cl))} result_list = register.inclusion_tag("admin/change_list_results")(result_list) -#@register.inclusion_tag("admin/date_hierarchy") def date_hierarchy(cl): lookup_opts, params, lookup_params, lookup_mod = \ cl.lookup_opts, cl.params, cl.lookup_params, cl.lookup_mod @@ -260,7 +256,6 @@ def date_hierarchy(cl): } date_hierarchy = register.inclusion_tag('admin/date_hierarchy')(date_hierarchy) -#@register.inclusion_tag('admin/search_form') def search_form(cl): return { 'cl': cl, @@ -269,12 +264,10 @@ def search_form(cl): } search_form = register.inclusion_tag('admin/search_form')(search_form) -#@register.inclusion_tag('admin/filter') def filter(cl, spec): return {'title': spec.title(), 'choices' : list(spec.choices(cl))} filter = register.inclusion_tag('admin/filter')(filter) -#@register.inclusion_tag('admin/filters') def filters(cl): return {'cl': cl} filters = register.inclusion_tag('admin/filters')(filters) diff --git a/django/contrib/admin/templatetags/admin_modify.py b/django/contrib/admin/templatetags/admin_modify.py index 3b60ed3f6a..4f161e2b7f 100644 --- a/django/contrib/admin/templatetags/admin_modify.py +++ b/django/contrib/admin/templatetags/admin_modify.py @@ -15,12 +15,10 @@ word_re = re.compile('[A-Z][a-z]+') def class_name_to_underscored(name): return '_'.join([s.lower() for s in word_re.findall(name)[:-1]]) -#@register.simple_tag def include_admin_script(script_path): return '' % (ADMIN_MEDIA_PREFIX, script_path) include_admin_script = register.simple_tag(include_admin_script) -#@register.inclusion_tag('admin/submit_line', takes_context=True) def submit_row(context, bound_manipulator): change = context['change'] add = context['add'] @@ -39,7 +37,6 @@ def submit_row(context, bound_manipulator): } submit_row = register.inclusion_tag('admin/submit_line', takes_context=True)(submit_row) -#@register.simple_tag def field_label(bound_field): class_names = [] if isinstance(bound_field.field, meta.BooleanField): @@ -171,12 +168,10 @@ class EditInlineNode(template.Node): context.pop() return output -#@register.simple_tag def output_all(form_fields): return ''.join([str(f) for f in form_fields]) output_all = register.simple_tag(output_all) -#@register.simple_tag def auto_populated_field_script(auto_pop_fields, change = False): for field in auto_pop_fields: t = [] @@ -194,7 +189,6 @@ def auto_populated_field_script(auto_pop_fields, change = False): return ''.join(t) auto_populated_field_script = register.simple_tag(auto_populated_field_script) -#@register.simple_tag def filter_interface_script_maybe(bound_field): f = bound_field.field if f.rel and isinstance(f.rel, meta.ManyToMany) and f.rel.filter_interface: @@ -219,7 +213,6 @@ def register_one_arg_tag(node): register_one_arg_tag(FieldWidgetNode) register_one_arg_tag(EditInlineNode) -#@register.inclusion_tag('admin/field_line', takes_context=True) def admin_field_line(context, argument_val): if (isinstance(argument_val, BoundField)): bound_fields = [argument_val] @@ -247,8 +240,6 @@ def admin_field_line(context, argument_val): } admin_field_line = register.inclusion_tag('admin/field_line', takes_context=True)(admin_field_line) -#@register.simple_tag def object_pk(bound_manip, ordered_obj): return bound_manip.get_ordered_object_pk(ordered_obj) - object_pk = register.simple_tag(object_pk) diff --git a/django/contrib/admin/templatetags/adminmedia.py b/django/contrib/admin/templatetags/adminmedia.py index 3238bfcfc7..cd513f6c81 100644 --- a/django/contrib/admin/templatetags/adminmedia.py +++ b/django/contrib/admin/templatetags/adminmedia.py @@ -7,4 +7,4 @@ def admin_media_prefix(): except ImportError: return '' return ADMIN_MEDIA_PREFIX -admin_media_prefix = register.simple_tag(admin_media_prefix) \ No newline at end of file +admin_media_prefix = register.simple_tag(admin_media_prefix)