You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
class Animal(TypedModel):
name = models.CharField(max_length=100)
class Cat(Animal):
meow_volume = models.IntegerField()
owner_name = models.CharField(max_length=100)
class Dog(Animal):
bark_volume = models.IntegerField()
owner_name = models.CharField(max_length=100)
class Bear(Animal):
growl_volume = models.IntegerField()
But I get:
django.db.utils.ProgrammingError: column "owner_name" specified more than once
I know I could move 'owner_name' on to the base class but then Bears have an owner - which they shouldn't have.
Is there any way that the duplicate fields could be magically recognised and de-dupped? Obviously they would have to be identical - that would be a reasonable constraint to impose on this kind of arrangement.
The text was updated successfully, but these errors were encountered:
I was hoping this was possible:
But I get:
I know I could move 'owner_name' on to the base class but then Bears have an owner - which they shouldn't have.
Is there any way that the duplicate fields could be magically recognised and de-dupped? Obviously they would have to be identical - that would be a reasonable constraint to impose on this kind of arrangement.
The text was updated successfully, but these errors were encountered: