hzdg/django-enumfields — pull request #16 by stuglaser (2014-07-11 04:45:02+00:00)
Title: Handle zero-valued enums correctly

If your enum has names that match to 0 (zero), then django-enumfields fails to load them correctly, setting them to `None`. `EnumFieldMixin.to_python()` only checks the boolean-casted value of the DB column, and since 0 evaluates to `False`, it returns `None`.

This PR modifies `to_python()` so that it checks for `None` values more strictly.