Access parent class for a Django model

django, django-models

Solution

Not quite sure about relationship between `Store` and `Retailer`, can you post some code? To access `Retailer` instance by model-inheritance, use

hardware_store.retailer_ptr

Problem

I have a model structure along the lines of: ``` class Store(models.Model): STORE_TYPE = ( ('I', 'Ice Cream'), ('H', 'Hardware'), ) retailer_type = models.CharField(max_length=10, choices=STORE_TYPE) ... class HardwareStore(Store): hammers_stocked = models.BooleanField() ``` If I have an instance of `HardwareStore`, how do I access the `Store` object. I'm currently using ``` Retailer.objects.get(pk=hardware_store.pk) ``` where `hardware_store` is an instance of `HardwareStore` but that seems clunky

Original source