mirror of
https://github.com/Hopiu/wagtail.git
synced 2026-04-26 01:24:49 +00:00
Django 1.8 support in edit handlers
This commit is contained in:
parent
4f2affcb60
commit
012209cc24
1 changed files with 3 additions and 3 deletions
|
|
@ -6,7 +6,7 @@ import warnings
|
|||
from six import text_type
|
||||
|
||||
from modelcluster.forms import ClusterForm, ClusterFormMetaclass
|
||||
|
||||
from modelcluster.models import get_related_model
|
||||
|
||||
from django.db import models
|
||||
from django.template.loader import render_to_string
|
||||
|
|
@ -584,7 +584,7 @@ class BaseInlinePanel(EditHandler):
|
|||
return cls.panels
|
||||
# Failing that, get it from the model
|
||||
else:
|
||||
return extract_panel_definitions_from_model_class(cls.related.model, exclude=[cls.related.field.name])
|
||||
return extract_panel_definitions_from_model_class(get_related_model(cls.related), exclude=[cls.related.field.name])
|
||||
|
||||
_child_edit_handler_class = None
|
||||
|
||||
|
|
@ -592,7 +592,7 @@ class BaseInlinePanel(EditHandler):
|
|||
def get_child_edit_handler_class(cls):
|
||||
if cls._child_edit_handler_class is None:
|
||||
panels = cls.get_panel_definitions()
|
||||
cls._child_edit_handler_class = MultiFieldPanel(panels, heading=cls.heading).bind_to_model(cls.related.model)
|
||||
cls._child_edit_handler_class = MultiFieldPanel(panels, heading=cls.heading).bind_to_model(get_related_model(cls.related))
|
||||
|
||||
return cls._child_edit_handler_class
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue