Код: Выделить всё
#custom_tags.py
def modulo(value, number,number2):
mod = value % number
if mod == number2:
return True
else:
return False
Код: Выделить всё
{% comment %} index.html {% endcomment %}
{% for post in posts|slice:"1:"%}
{% if post.id|modulo:4:0 %}
[url={{post.slug}}]
[img]{{post.image.url}}[/img]
[/url]
{{post.category}} • {{post.created_date}}
[url=single-post.html]{{ post.title }}[/url]
{% endif %}
{% endfor %}
Когда Я изменяю значение с помощью переменной номер, я хочу проверить результат с помощью переменной номер2
Подробнее здесь: https://stackoverflow.com/questions/757 ... 2-provided