X-Git-Url: https://git.mdrn.pl/django-migdal.git/blobdiff_plain/734cd58d3f12c5397b42c1ae122c947500386014..c176b125612945be925d25922a6fe1db4d1def50:/migdal/fields.py diff --git a/migdal/fields.py b/migdal/fields.py index 843c44e..c9fe7fc 100644 --- a/migdal/fields.py +++ b/migdal/fields.py @@ -4,15 +4,16 @@ # from django.db import models + class SlugNullField(models.SlugField): description = "SlugField that stores NULL instead of blank value." - def to_python(self, value, **kwargs): - value = super(SlugNullField, self).to_python(value, **kwargs) + def to_python(self, value): + value = super(SlugNullField, self).to_python(value) return value if value is not None else u"" def get_prep_value(self, value, **kwargs): - value = super(SlugNullField, self).get_prep_value(value, **kwargs) + value = super(SlugNullField, self).get_prep_value(value) return value or None