Quantcast
Channel: Adding a value to a variable in Django templates - Stack Overflow
Browsing latest articles
Browse All 4 View Live

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 Article


Answer 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 Article

Answer 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 Article

Adding 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
Browsing latest articles
Browse All 4 View Live




<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>