goinnn/django-multiselectfield — pull request #7 by Akuryou (2013-12-18 16:27:59+00:00)
Title: Empty values

Hi,
I expanded the handling for empty and null values.

Empty values:
By default empty strings from database will be converted to [u'']
This breaks validations such as calling full_clean() on the model since u'' will usually not be a valid choice.
(Try it yourself with the current example setup)
Furthermore if a DB value represents "nothing selected" it should be transformed to [] not '' to prevent switching types.

Null/None values:
Right now null values will be transformed to ''
This may cause trouble for some users that want to distinguish between null, "nothing selected" and "x entries selected" since it sets null == '' == "noting selected"

Because users are free to define the handling of null values with null=true/false and blank=true/false in field definitions this should be respected by the field.