Ticket #20423: number_templating.diff

File number_templating.diff, 515 bytes (added by antonio@…, 6 years ago)

Patch to assign context to numeric Variables in Django templating

  • django/template/base.py

    diff --git a/django/template/base.py b/django/template/base.py
    index c5bddaf..6e3f582 100644
    a b class Variable(object): 
    703703            # dot or an "e" then it was a float, not an int.
    704704            if '.' not in var and 'e' not in var.lower():
    705705                self.literal = int(self.literal)
     706                self.lookups = tuple(var.split(VARIABLE_ATTRIBUTE_SEPARATOR))
    706707
    707708            # "2." is invalid
    708709            if var.endswith('.'):
Back to Top