Is it possible for one Django model to inherit from two other models, one as abstract, one as proxy?

Viewed 45

Is it possible for one model to both inherit from abstract model, while acting as proxy model of another?

from django.db import models

class Vehicle(models.Model):
    brand = models.CharField(max_length=30)

    class Meta:
        abstract: true

class Car(models.Model):
    brand = models.CharField(max_length=30)
    color = models.CharField(max_length=30)

# Is this possible?
class MyCar(Car, Vehicle):
    class Meta:
        proxy = True

Would MyCar be a proxy of Car with the added fields from Vehicle?

0 Answers
Related