How to read django autocomplete lights value to generate choices dynamically?
<p>Hey i would like to get the value of django autocomplete light in the model form and generate choices for the next fields accordingly.</p>

<pre><code>class GroupPropertiesForm(forms.ModelForm):
  &lt;strike&gt;fields['equipment_grade']: forms.ChoiceField(
            choices=[(o.id, str(o))
                     for o in GroupProperties.objects.all(group=???group???)]&lt;/strike&gt;
 class Meta:
    model = GroupProperties
    fields = ('group', 'bells')
    widgets = {
        'group': autocomplete.ModelSelect2(
            url='groups-autocomplete')
        )
    }
</code></pre>

<p>This is not the correct way to implement this functionality,
autocomplete light will provide information as a forward for the next attribute as they have written <a href="https://django-autocomplete-light.readthedocs.io/en/master/tutorial.html#filtering-results-based-on-the-value-of-other-fields-in-the-form" rel="nofollow">Django auto complete light documentation</a></p>

python django django-forms django-admin django-autocomplete-light