django-pghistory icon indicating copy to clipboard operation
django-pghistory copied to clipboard

Use concrete models when filtering event models by proxy models

Open lokhman opened this issue 7 months ago • 0 comments

When core.event_models function filters event models by proxy references_model or tracks_model, it should use the concrete model for filtering.

It will allow showing correct results in the Events admin when checking events for ProxyModel in this example:

@pghistory.track()
class BaseModel(models.Model):
    ...

class ProxyModel(models.Model):
    ...

    class Meta:
        proxy = True

N.B.: Filtering by obj works correctly because _filter_event_models uses obj.__class__ for that.

Type: bug

lokhman avatar Jul 02 '24 15:07 lokhman