↧
Answer by Lorenzo Peña for Adding a value to a variable in Django templates
You basically can't. Apart from what Rahul Gupta said, Django has an explicit design philosohpy to prevent advanced logic in templates (although substracting is not advanced logic at all):The template...
View ArticleAnswer by Rahul Gupta for Adding a value to a variable in Django templates
Django does not provide a built-in template tag/filter to do subtraction. Also, there is no built-in filter for converting a positive integer to negative. You would have to write a template tag for...
View ArticleAnswer by var211 for Adding a value to a variable in Django templates
You need something like:{{ pagecontrol.start_page|sub:pagecontrol.new_per_page }}
View ArticleAdding a value to a variable in Django templates
This is a very quick question, which I think may be a limitation in the templates.I'm adding a value to a variable in a template using the |add:"num" feature, I'm trying to use another variable as the...
View Article
More Pages to Explore .....