Closed kmmbvnr closed 5 months ago
Can't reproduce
from django.db import models
from polymorphic.models import PolymorphicModel
class Project(PolymorphicModel):
topic = models.CharField(max_length=30)
class ArtProject(Project):
artist = models.CharField(max_length=30)
class ResearchProject(Project):
supervisor = models.CharField(max_length=30)
from django.contrib import admin
from guardian.admin import GuardedModelAdmin
from . import models
@admin.register(models.Project)
class ProjectAdmin(GuardedModelAdmin):
pass
@admin.register(models.ArtProject)
class ArtProjectAdmin(GuardedModelAdmin):
pass
@admin.register(models.ResearchProject)
class ResearchProjectAdmin(GuardedModelAdmin):
pass
Closed as https://github.com/django-guardian/django-guardian/issues/778#issuecomment-2097302146
Probably the use was created tables before, and only then make the class abstract. The django-polymorphic itself does not allow to have base abstract classes
Found a way to reproduce
Find that permissions is not create for the abstract classes by Django, but in case if they created manually, everything works fine https://github.com/django-guardian/django-guardian/issues/778#issuecomment-2098279253
Original issue: https://github.com/django-guardian/django-guardian/issues/778