Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class CharFieldNoEmptyString(CharField):
- def get_prep_value(self, value):
- # Cast empty strings to null before saving to the DB.
- value = (
- super(CharFieldNoEmptyString, self)
- .get_prep_value(value)
- )
- return value or None
Add Comment
Please, Sign In to add comment