1
0
mirror of https://github.com/django/django.git synced 2025-10-23 21:59:11 +00:00

Fixed #4136 -- Made ModelForm save empty values for nullable CharFields as NULL.

Previously, empty values were saved as strings.
This commit is contained in:
Jon Dufresne
2016-05-18 07:30:42 -07:00
committed by Tim Graham
parent f2c0eb19e9
commit 267dc4addd
9 changed files with 66 additions and 18 deletions

View File

@@ -483,3 +483,7 @@ class StrictAssignmentAll(models.Model):
class Award(models.Model):
name = models.CharField(max_length=30)
character = models.ForeignKey(Character, models.SET_NULL, blank=False, null=True)
class NullableUniqueCharFieldModel(models.Model):
codename = models.CharField(max_length=50, blank=True, null=True, unique=True)