daily pastebin goal
23%
SHARE
TWEET

Untitled

a guest Jun 14th, 2018 56 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. def my_private_tag(value, arg):
  2.   return value + ' ' + arg
  3.    
  4. {% if name %}
  5.  
  6.   # to display
  7.   # John says hello
  8.   {{name.first | my_private_tag:"says hello"}
  9.  
  10.   # Johns student id = id_value
  11.   {{name.first | my_private_tag:"????????"}
  12.  
  13.   # Johns student id = id_value, lastname = lastname_value
  14.   {{name.first | my_private_tag:"????????"}
  15.  
  16. {% endif %}
  17.    
  18. id_value = name.id & lastname_value = name.last
  19.    
  20. {{name.first }} says hello
  21. {{name.first }}'s student id = {{ name.id }}
  22.    
  23. {{name.first|my_private_tag:name.id}}
  24.    
  25. Johns student id = 47, lastname = Doe
  26.    
  27. {{name|my_private_tag:"??????"}}
  28.    
  29. return name.first_name + "s student id = " + name.id + ", lastname = " + name.last_name
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top