jazzband / django-polymorphic

Improved Django model inheritance with automatic downcasting
https://django-polymorphic.readthedocs.io
Other
1.66k stars 280 forks source link

Replace deepcopy of the Q object #543

Open rrauenza opened 1 year ago

rrauenza commented 1 year ago

Still trying to run unit tests locally, hoping marking this PR as ready would trigger some on project side.

rrauenza commented 1 year ago

See https://github.com/django-polymorphic/django-polymorphic/issues/542

TomHaii commented 1 year ago

Can also confirm that is indeed fixing the issue in deepcopying Q objects. (reproduced on Python 3.7)

alphatownsman commented 1 year ago

Is there some unittest can cover the case it fixes?

rrauenza commented 1 year ago

I think if the existing unit tests work, that is sufficient, since it shows the change doesn't break from the current method of copying.

We could assign a non picklable object attr to one of the children to prevent future regression?

AdamDonna commented 1 year ago

+1 to adding a non picklable object attr to prevent future regressions or even an explicit scenario that should break in 3.7 without this fix