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
Not quite sure about relationship between
StoreandRetailer, can you post some code?To access
Retailerinstance by model-inheritance, use