Allow null & blank for PickleField. (#315)

The default behaviour of PickleField was changed from null=True to
null=False. This causes issues with fields such as an image_field which
will try storing a NULL when unset.
This commit is contained in:
Tyler Kennedy 2019-03-16 10:47:43 -04:00 committed by Camilo Nova
parent a31d6f195f
commit 5e422cfd54
2 changed files with 20 additions and 1 deletions

View file

@ -0,0 +1,19 @@
# Generated by Django 2.1.5 on 2019-01-30 04:04
from django.db import migrations
import picklefield.fields
class Migration(migrations.Migration):
dependencies = [
('database', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='constance',
name='value',
field=picklefield.fields.PickledObjectField(blank=True, editable=False, null=True),
),
]

View file

@ -13,7 +13,7 @@ except ImportError:
class Constance(models.Model):
key = models.CharField(max_length=255, unique=True)
value = PickledObjectField()
value = PickledObjectField(null=True, blank=True)
class Meta:
verbose_name = _('constance')