Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Update ext/forms.py

one slight facelift in forms.IntegerArrayField
  • Loading branch information...
commit fcf41c82a3f306123e11f1fd9e9772eb8bd65ae8 1 parent bbcd24e
Jonathan S. Katz authored
Showing with 3 additions and 2 deletions.
  1. +3 −2 ext/forms.py
5 ext/forms.py
View
@@ -10,7 +10,8 @@ def __init__(self, **kwargs):
def prepare_value(self, value):
if isinstance(value, list):
- return re.sub(r'\[|\]', '', str(value))
+ encoded_values = [unicode(x) for x in value]
+ return ",".join(encoded_values)
return value
def validate(self, value):
@@ -31,4 +32,4 @@ def validate(self, value):
super(MoneyField, self).validate(value)
value = re.sub(',|\$', '', value)
if not re.search('^[1-9][0-9]*(\.[0-9]{2})?$', value):
- raise forms.ValidationError, "Please enter in a proper money format (99 or 99.99)"
+ raise forms.ValidationError, "Please enter in a proper money format (99 or 99.99)"
Please sign in to comment.
Something went wrong with that request. Please try again.