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
This commit is contained in:
Adrian Holovaty 2006-01-19 03:29:45 +00:00
parent bfaff07990
commit 2483ed749b
3 changed files with 1 additions and 17 deletions

View File

@ -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 '<a href="%s"%s>%d</a> ' % (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)

View File

@ -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 '<script type="text/javascript" src="%s%s"></script>' % (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)

View File

@ -7,4 +7,4 @@ def admin_media_prefix():
except ImportError:
return ''
return ADMIN_MEDIA_PREFIX
admin_media_prefix = register.simple_tag(admin_media_prefix)
admin_media_prefix = register.simple_tag(admin_media_prefix)