|
@@ -21,12 +21,17 @@ class CommaSeparatedCharField(models.CharField):
|
|
def to_python(self, value):
|
|
def to_python(self, value):
|
|
if isinstance(value, CommaSeparatedList):
|
|
if isinstance(value, CommaSeparatedList):
|
|
return value
|
|
return value
|
|
|
|
+ elif isinstance(value, collections.Iterable):
|
|
|
|
+ return CommaSeparatedList(value)
|
|
|
|
|
|
- if value is None:
|
|
|
|
|
|
+ elif value is None:
|
|
return value
|
|
return value
|
|
|
|
|
|
return CommaSeparatedList([i.strip() for i in value.split(',')])
|
|
return CommaSeparatedList([i.strip() for i in value.split(',')])
|
|
|
|
|
|
|
|
+ def clean(self, *args, **kwargs):
|
|
|
|
+ return super().clean(*args, **kwargs)
|
|
|
|
+
|
|
def get_prep_value(self, value):
|
|
def get_prep_value(self, value):
|
|
if isinstance(value, collections.Iterable):
|
|
if isinstance(value, collections.Iterable):
|
|
return ','.join(value)
|
|
return ','.join(value)
|