B
B
bq9112020-04-22 17:13:26
Django
bq911, 2020-04-22 17:13:26

Why doesn't a condition fire in a django template?

Why doesn't a condition fire in a django template?
{% if cart.total <= 3000 %} disabled{% endif %}

Getting the amount of goods:

def total(self):
        total = float()
        for item in self.items():
            total += float(item.total())
        return "{0:.0f}".format(total)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dr. Bacon, 2020-04-22
@bq911

And how to compare a string with a number?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question