This repository has been archived on 2022-08-01. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
DEMOS2/allauthdemo/polls/templatetags/custom_filters_tags.py

9 lines
265 B
Python
Executable file

from django import template
register = template.Library()
#get a value for additively homomorphic encryption ballots
#we can't do maths in the template normally so a filter is a way around it
@register.filter
def get_ballot_value(value):
return pow(10, value-1)