Merge pull request #27 from dmitry-krasilnikov/master
Specifying default value in South fixed
This commit is contained in:
commit
d34f743e2b
1 changed files with 5 additions and 0 deletions
|
@ -104,6 +104,11 @@ class MultiSelectField(models.CharField):
|
|||
def get_prep_value(self, value):
|
||||
return '' if value is None else ",".join(value)
|
||||
|
||||
def get_db_prep_value(self, value, connection, prepared=False):
|
||||
if not prepared and not isinstance(value, string_type):
|
||||
value = self.get_prep_value(value)
|
||||
return value
|
||||
|
||||
def to_python(self, value):
|
||||
if value:
|
||||
return value if isinstance(value, list) else value.split(',')
|
||||
|
|
Loading…
Reference in a new issue