You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
class PersonBlock(blocks.StructBlock):
first_name = blocks.CharBlock()
surname = blocks.CharBlock()
photo = ImageChooserBlock(required=False)
biography = blocks.RichTextBlock()
class Meta:
icon = 'user'
At the moment, wagtail-factories only supports the class-based definition:
class MyTestPageFactory(wagtail_factories.PageFactory):
body = wagtail_factories.StreamFieldFactory({
'carousel': MyCarouselFactory
})
class Meta:
model = models.MyTestPage
MyCarouselFactory has to be a subclass of wagtail_factories.StructBlockFactory, which depends on there being a class definition of the struct block.
Hopefully I will get time to look into this more. Has anyone come across this before, or have any ideas about how to solve it?
The text was updated successfully, but these errors were encountered:
A struct block doesn't necessarily always have it's own class definition.
From Wagtail's docs (http://docs.wagtail.io/en/v2.0/topics/streamfield.html#structblock):
This is an alternate to defining a class:
At the moment, wagtail-factories only supports the class-based definition:
MyCarouselFactory
has to be a subclass ofwagtail_factories.StructBlockFactory
, which depends on there being a class definition of the struct block.Hopefully I will get time to look into this more. Has anyone come across this before, or have any ideas about how to solve it?
The text was updated successfully, but these errors were encountered: