Skip to content

Using current main of django-postgres-extra PostgresPartitionedModel breaks @admin.register in Django 5.2 #265

Description

@ldaniluk

Due to forced usage CompositePrimaryKey in the metaclass PostgresPartitionedModelMeta, the partitioned views can no longer be used with Django admin in Django 5.2:

django.core.exceptions.ImproperlyConfigured: The model MyXyzModel has a composite primary key, so it cannot be registered with admin.

According to the documentation this is indeed not a supported interaction yet.

Models with composite primary keys cannot be registered in the Django admin at this time. You can expect to see this in future releases.

Additionally, there are limitations regarding usage of ForeignKey:

ForeignKey currently cannot reference models with composite primary keys.

Is the usage of CompositePrimaryKey a requirement for Django 5.2 support?
If it is not, could it be made configurable, instead of being mandatory?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions