Skip to content

Multi-table model inheritance using parent_link not working #48

Open
@jackappleby

Description

@jackappleby

I have a few models that inherit from a parent one, for example:

class ContentItem(models.Model):

    class Meta:
        ordering = ['position']

    content_group = models.ForeignKey(ContentGroup)
    position      = PositionField(collection='content_group', parent_link='contentitem_ptr')


class Text(ContentItem):

    title = models.CharField(max_length=500, unique=False, null=True, blank=True)

I understand I need to use the parent_link argument. But I get this error when I use it:

websites.Text: (models.E015) 'ordering' refers to the non-existent field 'position'.

I've tried various field names such as websitecontentitem_ptr, websitecontentitem_ptr_id etc but no luck. What am I doing wrong?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions