I posted this to django-users a few days ago but no one commented and I
didn't see any mention of it here so I thought I'd repost to the dev
group. I'm using M-R and just updated to 2721 and still didn't see a
fix.

If you use a FloatField in the admin list_display, you get an error
rendering the template from line 160 in admin_list.py (TypeError, float
argument required)

158.            elif isinstance(f, models.FloatField):
159.                if field_val is not None:
160.                    result_repr = ('%%.%sf' % f.decimal_places) %
field_val
161.                else:
162.                    result_repr = EMPTY_CHANGELIST_VALUE


This is because FloatFields are stored as strings so you can't use one
directly in a %f format. I think the line should be:

160.                    result_repr = ('%%.%df' % f.decimal_places) %
float(field_val)

But I'm not sure if that should be float() or Decimal().

Thanks, 
-Dave


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to django-developers@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-developers
-~----------~----~----~----~------~----~------~--~---

Reply via email to