Opened 6 years ago

Last modified 6 years ago

#29306 closed Bug

[bugs for all version]Template variable-lookups system evaluate callables before completed the evaluation — at Initial Version

Reported by: Luoxzhg Owned by: nobody
Component: Template system Version: dev
Severity: Normal Keywords: template
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

class A:
    class B:
         attr="Hello"

from django.template import Template, Context
t = Template(" {{  A.B.attr }}")
output=t.render(Context({"A": A}))

the output should be "Hello", but it is string_if_invalid, i.e., empty string "" .

Change History (0)

Note: See TracTickets for help on using tickets.
Back to Top