How to escape double curly brackets in views

19 views
Skip to first unread message

Vincent Borghi

unread,
Dec 16, 2021, 3:10:13 AM12/16/21
to web2py-users
Hello,

I have a view which contains "normal" placeholders like {{=myvariable}}.

My problem is that the view must sometimes includes double curly brackets,  {{ and }}, that are to be ignored by the web2py view renderer. So how to escape them? What is the mean to have both "normal" and escaped double curly brackets in my view?

PS: The "{{ }}"" are used by some expressions in the "simile exhibit" framework, that I used with web2py, hence my need.

Thanks
Vincent

Jim S

unread,
Dec 16, 2021, 12:34:04 PM12/16/21
to web2py-users
You can change the web2py delimiters as mentioned here -> http://web2py.com/books/default/chapter/29/05/the-views#The-views

in db.py add:

response.delimiters = ("[[", "]]")

to use [[ and ]]

Reply all
Reply to author
Forward
0 new messages