Add a get_panel definition on StreamField to ensure it uses StreamFieldPanel.

This will probably only get used in very obscure cases (streamfields inside inline panels that don't have an explicit panel def) but it can't hurt to add it...
This commit is contained in:
Matt Westcott 2015-03-03 11:45:32 +00:00
parent 3d314b80ae
commit 1df3b6f7b9

View file

@ -54,6 +54,10 @@ class StreamField(with_metaclass(models.SubfieldBase, models.Field)):
def get_internal_type(self):
return 'TextField'
def get_panel(self):
from wagtail.wagtailadmin.edit_handlers import StreamFieldPanel
return StreamFieldPanel
def deconstruct(self):
name, path, _, kwargs = super(StreamField, self).deconstruct()
block_types = self.stream_block.child_blocks.items()