Changeset 2062
- Timestamp:
- 06/25/09 10:37:47 (9 months ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
branches/0.9/pylucid_project/apps/pylucid/fields.py
r2060 r2062 39 39 if not isinstance(value, basestring): 40 40 raise exceptions.ValidationError(_("CSS color value is not a basestring!")) 41 41 42 42 if len(value) not in (3, 6): 43 43 raise exceptions.ValidationError(_("Wrong CSS color length (only 3 or 6 characters)")) 44 44 45 45 if not CSS_VALUE_RE.match(value): 46 46 raise exceptions.ValidationError(_("Error: %r is not a CSS hex color value") % value) … … 69 69 """ validate the form data """ 70 70 value = super(ColorValueFormField, self).clean(value) 71 validate_css_ ColorValue_value(value)71 validate_css_color_value(value) 72 72 self.value = value 73 73 return value … … 83 83 def get_db_prep_save(self, value): 84 84 "Returns field's value prepared for saving into a database." 85 validate_css_ ColorValue_value(value)85 validate_css_color_value(value) 86 86 return value 87 87 88 88 def to_python(self, value): 89 validate_css_ ColorValue_value(value)89 validate_css_color_value(value) 90 90 return value 91 91