Multi-table inheritance - how to use inherited id for relations?

In my project I had 2 different set of models for 2 different reports.

TestsReport <-- TestRuns
MetricsReport <-- Metrics --> Values 

Then I had to create common Report model to unify and speed up some queries.
First I used just standard explicit ForeignKey relations from TestsReport and MetricsReport to Report and it works fine, but it leads to 3 different set of IDs while just single report ID would be enough.
Also, this way I have to redo access to common fields - say write testReport.report.timestamp instead of testReport.timestamp.

I tried to use Multi-table Inheritance to overcome these drawbacks, but failed to connect TestRuns to TestsReport and Metrics to MetricsReport just using ID these tables inherited from common Report model.

# excerpt from models.py

class HashField(models.DecimalField):
    def __init__(self, *args, **kwargs):
        super().__init__(*args, **dict(kwargs, max_digits=39, decimal_places=0))

class Report(models.Model):
    id = HashField(primary_key=True, unique=True)
    timestamp = models.DateTimeField()
    # some other fields

class TestsReport(Report):
    # some fields

class MetricsReport(Report):
    # some fields

This no longer works:

class TestRuns(models.Model):
    tests_report = models.ForeignKey('TestsReport', on_delete=models.CASCADE)
    # some other fields

Django still creates tests_report_id field in TestRuns table, but it is not connected via foreign key to TestReport’s report_ptr_id field Django created as a result of inheritance.

What has to be done to make Multi-table inheritance work with relationships from other models?

Welcome @sknaumov !

I’m not sure I’m following what you’re trying to describe as the issue.

As you point out, this is fairly standard, so why is it a problem?

Again, standard. Why is this a problem?

Please clarify what you mean by this.

Nothing special. Your foreign key in those other models can either refer to the parent or descendant models.

If you are getting some kind of errors when doing this, please post the code and the complete error with the traceback.