Skip to content

Commit fd84b41

Browse files
committed
follow the docs and use runtime import
1 parent 0f80d82 commit fd84b41

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

wagtailstreamforms/blocks.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,6 @@
55
from django.utils.translation import gettext_lazy as _
66
from wagtail import blocks
77

8-
from wagtailstreamforms.models import Form
9-
from wagtailstreamforms.wagtail_hooks import WagtailStreamFormsChooser
10-
118

129
class InfoBlock(blocks.CharBlock):
1310
def render_form(self, value, prefix="", errors=None):
@@ -19,10 +16,14 @@ def render_form(self, value, prefix="", errors=None):
1916
class FormChooserBlock(blocks.ChooserBlock):
2017
@cached_property
2118
def target_model(self):
19+
from .models import Form
20+
2221
return Form
2322

2423
@cached_property
2524
def widget(self):
25+
from .wagtail_hooks import WagtailStreamFormsChooser
26+
2627
return WagtailStreamFormsChooser()
2728

2829
def get_form_state(self, value):

0 commit comments

Comments
 (0)