#5355: DecimalField may "clean" itself and then raise an Exception
-------------------------------------------+--------------------------------
Reporter: Weipin Xia <[EMAIL PROTECTED]> | Owner: adrian
Status: new | Component: django.newforms
Version: SVN | Keywords:
Stage: Unreviewed | Has_patch: 1
-------------------------------------------+--------------------------------
DecimalField may "clean" itself and then raise an Exception. In my case,
it happens when I put a DecimalField in a django.newforms.Form class which
will be used to "Edit" the model.
I suppose it would be necessary to check the type of parameter '''value'''
like some of the other "Field" classes, such as DateField.
{{{
super(DecimalField, self).clean(value)
if not self.required and value in EMPTY_VALUES:
return None
value = value.strip() # raise AttributeError, 'Decimal' object
has no attribute 'strip'
try:
value = Decimal(value)
}}}
--
Ticket URL: <http://code.djangoproject.com/ticket/5355>
Django Code <http://code.djangoproject.com/>
The web framework for perfectionists with deadlines
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---