from __future__ import absolute_import

from widgy.site import WidgySite
from widgy.contrib.page_builder.models import Accordion, Section
from widgy.contrib.widgy_i18n.models import I18NLayout
from widgy import registry

from demo.demo_widgets.models import TwoContentLayout


class DemoWidgySite(WidgySite):
    def valid_parent_of(self, parent, child_class, obj=None):
        if isinstance(parent, I18NLayout):
            return True
        else:
            return super(DemoWidgySite, self).valid_parent_of(parent, child_class, obj)

widgy_site = DemoWidgySite()

from __future__ import absolute_import

from widgy.site import WidgySite


class DemoWidgySite(WidgySite):
    def valid_parent_of(self, parent, child_class, obj=None):
        if isinstance(parent, I18NLayout):
            return True
        else:
            return super(DemoWidgySite, self).valid_parent_of(parent, child_class, obj)

widgy_site = DemoWidgySite()

from widgy.contrib.widgy_i18n.models import I18NLayout

Fix the demo widgy site based on 448fc923ba