readd method assure_relation
@@ -308,6 +308,16 @@ class CascadePage(PageExtension):
def __str__(self):
return self.get_page().get_title()
+ @classmethod
+ def assure_relation(cls, cms_page):
+ """
+ Assure that we have a foreign key relation, pointing from CascadePage onto CMSPage.
+ """
+ try:
+ cms_page.cascadepage
+ except cls.DoesNotExist:
+ cls.objects.create(extended_object=cms_page)
+
@classmethod
def delete_cascade_element(cls, instance=None, **kwargs):
if isinstance(instance, CascadeModelBase):
