1 2 3 4 5 6 7 8 9 10 11 12 | class MultipleTypedChoiceModelField(models.Field):
"""
Saving value of all the checked checkboxes in the string
"""
def get_internal_type(self):
return 'MultipleTypedChoiceModelField'
def get_prep_value(self, value):
# In typical cases, you do not need to call additional methods,
# as incoming list already contains strings.
unicoded_val = [val.__unicode__() for val in value]
return ', '.join(unicoded_val)
|
More like this
- ByteSplitterField by Lacour 1 year, 8 months ago
- Multiple Choice model field by danielroseman 4 years, 6 months ago
- MultiSelectField with comma separated values (Field + FormField) by quinode 1 year ago
- Choices datatype for model by menendez 5 years, 1 month ago
- Subclassing a model.field for newforms by chasfs 6 years, 1 month ago
Comments
Welcome to our http://www.cauggboot.com online store. A variety of the latest ugg boots are stocked on our website.They are: http://www.australiauggshoe.com
#