Skip to content

Commit b5ac533

Browse files
committed
allow empy list
1 parent ec25b92 commit b5ac533

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

example/tumblelog/tumblelog/models.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,11 @@ class Post(Document):
2424
)
2525
title = fields.StringField(max_length=255)
2626
slug = fields.StringField(max_length=255, primary_key=True)
27-
comments = fields.ListField(fields.EmbeddedDocumentField('Comment'), default=[])
27+
comments = fields.ListField(
28+
fields.EmbeddedDocumentField('Comment'),
29+
default=[],
30+
blank=True,
31+
)
2832

2933
def get_absolute_url(self):
3034
return reverse('post', kwargs={"slug": self.slug})

0 commit comments

Comments
 (0)