Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
*.pyc
dist
*.egg-info
6 changes: 1 addition & 5 deletions nullablecharfield/forms/fields.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
from django.forms.fields import CharField
from django.utils.encoding import smart_str
from nullablecharfield.widgets import NullableTextWidget

class CharNullField(CharField):
Expand All @@ -16,7 +15,4 @@ def __init__(self, *args, **kwargs):
def to_python(self, value):
if value is None:
return None
return smart_str(value)

def get_db_prep_value(self, value):
return value
return super(CharNullField, self).to_python(value)