Guest User

Untitled

a guest
Dec 14th, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.27 KB | None | 0 0
  1. class CharFieldNoEmptyString(CharField):
  2. def get_prep_value(self, value):
  3. # Cast empty strings to null before saving to the DB.
  4. value = (
  5. super(CharFieldNoEmptyString, self)
  6. .get_prep_value(value)
  7. )
  8. return value or None
Add Comment
Please, Sign In to add comment