django-simple-history icon indicating copy to clipboard operation
django-simple-history copied to clipboard

as_of() and m2m fields - response gives non_historic values

Open baranma75 opened this issue 1 year ago • 4 comments

as_of() and m2m fields

receives in response the current non-history values for the m2m fields, how is it right to use as_of() with m2m fields?

baranma75 avatar Sep 15 '23 09:09 baranma75

I'm fairly sure this is a bug with the same cause as #1063 - which seems to be that each history record's instance property doesn't provide any related managers for the historical values of the M2M fields.

I started working on a fix around the time that issue was opened, but haven't gotten around to finish it yet, unfortunately.

ddabble avatar Sep 15 '23 18:09 ddabble

I will temporarily query the historical database with a separate query. Thanks.

baranma75 avatar Sep 16 '23 06:09 baranma75

Hello, I have the same problem. @ddabble is there a fix or a workaround? Thanks

frossigneux avatar Jan 11 '24 01:01 frossigneux

Hi,

I read by separate query from historictables and add/replace in result

baranma75 avatar Jan 11 '24 16:01 baranma75