On 05/11/2011 05:26 PM, Nan wrote:
Yeah, I'm aware of the distinction between the types -- just wasn't paying enough attention when I added the default and the filter, and had to back up and take a second look when the filter started throwing exceptions. So basically it's a weird artifact of how defaults are handled by the ORM?
No, this has nothing to do with the ORM itself, but rather the Field class of which DecimalField is a subclass. If you follow the link I sent earlier and read the code, you'll see that when you instantiate a Field (via a subclass such as DecimalField) and ask it for its default value, it calls a get_default function which converts the default value to unicode before returning it. In the case of a DecimalField, it makes it valid input for a decimal.Decimal declaration.
-- 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.