So, I have a decimalfield that can be 3 different values. In my view,
I pass in a dictionary of values that contains the appropriate decimal
values as keys.

{% for item in booklist %}
{% for key, value in numvec.items %}
{{item.number}}
{% ifequals item.number value %}
{{value}}
{% endifequals %}
{% endfor %}

this is the dict I pass in as numvec:
numvec = {"TEST":Decimal("0.999"), "TEST2":Decimal("0.500"),
"TEST3":Decimal("0.255")}

the number field was defined as having these choices in my model:
BOOK_CHOICES = (
    (Decimal("0.999"), 'TEST'),
    (Decimal("0.500"), 'TEST2'),
    (Decimal("0.255"), 'TEST3'),
)

The item number prints out just fine in the view if I compare the dict
with the attribute, but for some reason the ifequals cannot properly
compare two decimals together. Is this a bug, or am I doing something
wrong in my template with ifequals?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to