Skip to content

Commit 26a81ce

Browse files
committed
abstract block in test project
1 parent 61f3e6f commit 26a81ce

2 files changed

Lines changed: 12 additions & 3 deletions

File tree

test_project/pages/models.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,15 @@
22
from django.urls import reverse
33

44
from streamfield.fields import StreamField
5-
from streamblocks.models import RichText, Column
5+
from streamblocks.models import RichText, Column, Separator
66

77
class Page(models.Model):
88
title = models.CharField(max_length=255)
99
stream = StreamField(
1010
model_list=[
1111
RichText,
12-
Column
12+
Column,
13+
Separator
1314
],
1415
verbose_name="Page blocks"
1516
)

test_project/streamblocks/models.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,16 @@ class Meta:
2626
verbose_name="Column"
2727
verbose_name_plural="Columns"
2828

29+
30+
class Separator(models.Model):
31+
32+
class Meta:
33+
abstract = True
34+
verbose_name="Separator"
35+
2936
# Register blocks for StreamField as list of models
3037
STREAMBLOCKS_MODELS = [
3138
RichText,
32-
Column
39+
Column,
40+
Separator
3341
]

0 commit comments

Comments
 (0)