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.79k stars 467 forks source link

Add `class Formset(Forward)` #1313

Open bernd-wechner opened 1 year ago

bernd-wechner commented 1 year ago

We have Self(Forward) which forwards the field's own value.

But this is django-autocomplete-light and Django supports Formsets.

In a Formset, there's a field naming convention (on the id and name attributes) that is roughly form-n-field where form is the name of the form and field the name of the field and n the form number in the set (0, 1, 2, 3, ...).

Formset(Forward) would collect all the values of that field in the formset and submit them as a list. The server side can then use this list conveniently as an exclusion list to prevent, for example, any two forms in the formset having the same selection.

jpic commented 1 year ago

Sure, let's see what a patch looks like!