From: Guillaume Pellerin Date: Mon, 23 Jan 2023 19:44:43 +0000 (+0100) Subject: add randdom hash X-Git-Tag: 1.0^2~1 X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=376c5facbbb6176dd41e9a4e18ff410ad474791f;p=telecaster-client.git add randdom hash --- diff --git a/telecaster/templates/telecaster/base.html b/telecaster/templates/telecaster/base.html index 87f5742..4b05f69 100644 --- a/telecaster/templates/telecaster/base.html +++ b/telecaster/templates/telecaster/base.html @@ -78,7 +78,7 @@ jQuery(window).ready(function() { {% block video %}
{% endblock video %} diff --git a/telecaster/templatetags/telecaster_utils.py b/telecaster/templatetags/telecaster_utils.py index 349ec40..12025f4 100644 --- a/telecaster/templatetags/telecaster_utils.py +++ b/telecaster/templatetags/telecaster_utils.py @@ -23,9 +23,10 @@ register = template.Library() def len(list): return len(list) +@register.tag +def random_hash(parser, token): + return RandomHash() -@register.simple_tag(takes_context=True) -def get_random_hash(context): - return get_random_hash() - - +class RandomHash(template.Node): + def render(self, context): + return get_random_hash()