Linking ParentalKey to Abstract class and all subclasses in Wagtail

Viewed 137

I am setting up a website in Wagtail. I have Author snippets which include author information. Each page (BlogPage) can be related to multiple Authors (via an AuthorOrderable). I am now trying to add a new Page type, so I have created an abstract superclass for Authors to link to, however I get the following error:

AttributeError: type object 'BlogPage' has no attribute 'author_orderable'

class AbstractPage(Page):
    class Meta:
    abstract = True
            
    author_panels = [
        InlinePanel('author_orderable', label="Authors"),
    ]
        
class BlogPage(AbstractPage):
    #Some fields- authororderable is not listed here
        
class AuthorOrderable(Orderable, models.Model):
    page = ParentalKey('AbstractPage', on_delete=models.CASCADE, related_name='author_orderable')
    author = models.ForeignKey('Author', on_delete=models.CASCADE, related_name='+')
        
@register_snippet
class Author(models.Model):
    #Some fields
0 Answers
Related