Skip to content

Commit

Permalink
follow the docs and use runtime import
Browse files Browse the repository at this point in the history
  • Loading branch information
pjstevns committed Apr 21, 2023
1 parent 0f80d82 commit fd84b41
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions wagtailstreamforms/blocks.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@
from django.utils.translation import gettext_lazy as _
from wagtail import blocks

from wagtailstreamforms.models import Form
from wagtailstreamforms.wagtail_hooks import WagtailStreamFormsChooser


class InfoBlock(blocks.CharBlock):
def render_form(self, value, prefix="", errors=None):
Expand All @@ -19,10 +16,14 @@ def render_form(self, value, prefix="", errors=None):
class FormChooserBlock(blocks.ChooserBlock):
@cached_property
def target_model(self):
from .models import Form

return Form

@cached_property
def widget(self):
from .wagtail_hooks import WagtailStreamFormsChooser

return WagtailStreamFormsChooser()

def get_form_state(self, value):
Expand Down

0 comments on commit fd84b41

Please sign in to comment.