Initial commit
This commit is contained in:
49
env/lib/python3.10/site-packages/wagtail/test/streamfield_migrations/models.py
vendored
Normal file
49
env/lib/python3.10/site-packages/wagtail/test/streamfield_migrations/models.py
vendored
Normal file
@@ -0,0 +1,49 @@
|
||||
from django.db import models
|
||||
|
||||
from wagtail.blocks import CharBlock, ListBlock, StreamBlock, StructBlock
|
||||
from wagtail.fields import StreamField
|
||||
from wagtail.models import Page
|
||||
|
||||
|
||||
class SimpleStructBlock(StructBlock):
|
||||
char1 = CharBlock()
|
||||
char2 = CharBlock()
|
||||
|
||||
|
||||
class SimpleStreamBlock(StreamBlock):
|
||||
char1 = CharBlock()
|
||||
char2 = CharBlock()
|
||||
|
||||
|
||||
class NestedStructBlock(StructBlock):
|
||||
char1 = CharBlock()
|
||||
stream1 = SimpleStreamBlock()
|
||||
struct1 = SimpleStructBlock()
|
||||
list1 = ListBlock(CharBlock())
|
||||
|
||||
|
||||
class NestedStreamBlock(StreamBlock):
|
||||
char1 = CharBlock()
|
||||
stream1 = SimpleStreamBlock()
|
||||
struct1 = SimpleStructBlock()
|
||||
list1 = ListBlock(CharBlock())
|
||||
|
||||
|
||||
class BaseStreamBlock(StreamBlock):
|
||||
char1 = CharBlock()
|
||||
char2 = CharBlock()
|
||||
simplestruct = SimpleStructBlock()
|
||||
simplestream = SimpleStreamBlock()
|
||||
simplelist = ListBlock(CharBlock())
|
||||
nestedstruct = NestedStructBlock()
|
||||
nestedstream = NestedStreamBlock()
|
||||
nestedlist_struct = ListBlock(SimpleStructBlock())
|
||||
nestedlist_stream = ListBlock(SimpleStreamBlock())
|
||||
|
||||
|
||||
class SampleModel(models.Model):
|
||||
content = StreamField(BaseStreamBlock())
|
||||
|
||||
|
||||
class SamplePage(Page):
|
||||
content = StreamField(BaseStreamBlock())
|
||||
Reference in New Issue
Block a user