Skip to content

Inheritance model doesn't update sort. #329

@portedison

Description

@portedison

With inheritance, e.g. Writing, Event, etc all inheriting from Content. Creating Writing doesn't trigger (or implement) the admin mixin applied to the Content model. They add with the default value '0'. And subsequently can't be updated, as there are too many with the value of '0'. How should we trigger this to resort (similar to the management command) after save?

class Content(models.Model):
      sort_order = models.PositiveIntegerField(default=0, db_index=True)
      ...

class Writing(Content):
      ....

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