yourlabs / django-autocomplete-light

A fresh approach to autocomplete implementations, specially for Django. Status: v4 alpha, v3 stable, v2 & v1 deprecated.
https://django-autocomplete-light.readthedocs.io
MIT License
1.8k stars 467 forks source link

#1333 clone forwards #1358

Open ercpe opened 6 months ago

ercpe commented 6 months ago

When Django creates a Form instance from a form class, the fields and widgets are copied instead of instantiated. This means that every field/widget must implement deepcopy properly to create clones of any references it holds.

Implement __deepcopy__ in the WidgetMixin and copy the forward list to prevent forwards from leaking into unrelated forms when using a common base class.