Skip to content

Commit

Permalink
Remove ununsed tags
Browse files Browse the repository at this point in the history
  • Loading branch information
triole committed May 4, 2020
1 parent 1aa3d2a commit 33091ff
Showing 1 changed file with 0 additions and 32 deletions.
32 changes: 0 additions & 32 deletions rdmo/views/templatetags/view_tags.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,50 +38,18 @@ def get_values(context, attribute_path, set_index='*', index='*'):
return ''


@register.simple_tag(takes_context=True)
def get_numbers(context, attribute_path, set_index='*', index='*'):
numbers = []
for value_set in get_values(context, attribute_path, set_index, index):
numbers.append([value.as_number for value in value_set])
return numbers


@register.simple_tag(takes_context=True)
def get_set_values(context, set, attribute_path, index='*'):
return get_values(context, attribute_path, set.set_index, index)


@register.simple_tag(takes_context=True)
def get_set_numbers(context, set, attribute_path, index='*'):
return get_numbers(context, attribute_path, set.set_index, index)


@register.simple_tag(takes_context=True)
def get_set_sum(context, set, attribute_path, index='*'):
numbers = get_set_numbers(context, set, attribute_path, index)
return sum(numbers)


@register.simple_tag(takes_context=True)
def get_value(context, attribute_path, set_index=0, index=0):
return get_values(context, attribute_path, set_index, index)


@register.simple_tag(takes_context=True)
def get_number(context, attribute_path, set_index=0, index=0):
return get_numbers(context, attribute_path, set_index, index)


@register.simple_tag(takes_context=True)
def get_set_value(context, set, attribute_path, index=0):
return get_set_values(context, set, attribute_path, index)


@register.simple_tag(takes_context=True)
def get_set_number(context, set, attribute_path, index=0):
return get_set_numbers(context, set, attribute_path, index)


@register.simple_tag(takes_context=True)
def get_set(context, attribute_path):
id_path = attribute_path.rstrip('/') + '/id'
Expand Down

0 comments on commit 33091ff

Please sign in to comment.