Django-position - inherit a multi-table model using parent_link

Using https://github.com/jpwatts/django-positions ,

I have several models that inherit from the parent, 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 that I need to use the parent_link argument ( here is the documentation ). But I get this error when I use it:

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

When using the parent_link argument parent_link it is as if the position field has been completely removed from the model. I tried various field names like contentitem_ptr_id (actual link field name), but no luck. Is something identifiable I'm doing wrong here?

+5
source share
1 answer

class Meta: should appear after defining your field.

-1
source

All Articles