Multiple model inheritance with one concrete and one abstract model in django
I wanted to inherit the Grandparent abstract model, parent concert model in the child model. How I'll be able to achieve this in django? There are conflicts in field name as the abstract model is having audit fields. which is common going to be common in both parent and child class. How do I override or remove the common field coming from the parent model? Below is the models which showcase what I wanted to achieve.
class Audit(models.Model):
is_active = models.BooleanField(default=True)
created_at = models.DateTimeField(auto_now_add=True, null=True)
updated_at = models.DateTimeField(auto_now=True, null=True)
class Meta:
abstract = True
class User(Audit):
class Meta:
db_table = 'user'
email = models.EmailField(unique=True)
phone = models.CharField(validators=[phone_regex], max_length=50, unique=True)
is_active = models.BooleanField(default=False)
class UserProfile(User, Audit):
class Meta:
db_table = 'user_profile'
address = models.TextField(null=True)
profile_image = models.TextField(null=True)
dob = models.DateField()
.....