[Answer]-Django proxy admin

1👍

You cannot create a proxy-Model of an abstract class. Your Proxy-Model need to inherit from a non-abstract Model. Try to use proxy this way:

class AbstractBaseModel(models.Model):
    #some code

    class Meta():
        abstract = True

class MyModel(AbstractBaseModel):
    #some code

class ProxyModel(MyModel):
    #some code

    class Meta:
        proxy=True
👤Tobi

0👍

You’re supposed to do it like this, as stated in the documentation:

from django.db import models

class Person(models.Model):
    first_name = models.CharField(max_length=30)
    last_name = models.CharField(max_length=30)

class MyPerson(Person):
    class Meta:
        proxy = True

    def do_something(self):
        # ...
        pass

Leave a comment