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

datadump error: CommandError: Unable to serialize database: Must use .target() to target an object for event aggregation

Open asucrews opened this issue 3 years ago • 1 comments

Hello,

When using command manage.py dumpdata -o full_db.json, and i get the error "CommandError: Unable to serialize database: Must use .target() to target an object for event aggregation" I am unsure why this is happening and can't seem a way to fix it. if i exclude pghistory it works just fine.

asucrews avatar Oct 09 '21 21:10 asucrews

The only way I can successfully dump the data is by excluding two PG history models:

manage.py dumpdata --exclude pghistory.context --exclude pghistory.aggregateevent

xjlin0 avatar Apr 19 '22 00:04 xjlin0

I'm going to find a way to address this in a later release. Thanks for letting me know! Will mark this as a bug for now

wesleykendall avatar Sep 06 '22 01:09 wesleykendall

Found a workaround for this so that you don't always have to specify the exclude argument via https://github.com/Opus10/django-pghistory/pull/61

Will close when the fix is deployed

wesleykendall avatar Sep 07 '22 19:09 wesleykendall

fixed in version 2.4

wesleykendall avatar Sep 07 '22 23:09 wesleykendall