I am making a django project with models.py having following code:
class Record(models.Model):
id = models.AutoField(primary_key=True)
class TTAMRecord(Reco
As Record
is not abstract model, it has its own table and life cycle as other models. However, you can access the corresponding client object as record.ttamclient
, so you can change your line to
account = Account.objects.get(...)
for record in account.records.all():
client = record.ttamclient
...
However, this is little cumbersome if you have multiple derived classes. In such cases you would have to know which derived class you are referring to and use the corresponding attribute name.