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
- [Answer]-How do I let Heroku Know I have a requirements.txt file
- [Answer]-Django post request + jquery library
- [Answer]-How to upload data in model through migrations in django?
- [Answer]-Why do methods in Django's built-in ModelBackend return an empty set when an obj is passed in?
Source:stackexchange.com