DEV Community

Discussion on: Model Inheritance in Django

Collapse
 
hassansuhaib profile image
Hassan Suhaib

Whoever is reading this in the future make sure you add the following method to each product type class e.g:

class Label(Product):
objects = LabelManager()

class Meta:
proxy = True

def save(self, *args, **kwargs):
self.product_type = 'Label'
return super(Label, self).save(*args, **kwargs)

Otherwise you won't be able to see your object after it's creation. Cheers :)