I am building a website in google engine using python. Unfortunately, I could not find anything regarding my problem. I have to distinguish a variable according to its content.
For example, I'm going to send such variables
content = {
'mail':session.get('user_mail',''),
'role':'Admin',
}
render_template(self, 'index.html', content)
And I need such a code in order to understand the type of user if he is the user "Login" or "Administrator".
{% if role == 'Ordinary' %}
{{ role }}
{% elif role == 'Admin' %}
{{ role }}
{% endif %}
How can i do this?
Or maybe there is the best design you can offer me.
Thank...
source
share