Closed tobhv closed 3 months ago
hm. answer to my own question:
def __init__(self, *args, **kwargs):
super(MyUserForm, self).__init__(*args, **kwargs)
self.fields['group'].choices = list_groups()
issue solved..
A somehow cleaner way to solve this, is to create your own version of IncompleteSelectResponseMixin
. Here you fetch data from any other source. However, this in my opinion only makes sense if you have a non-ORM based database, such as Redis or MongoDB for instance.
Hello,
selectize looks good. documentation mentions how to create a dynamic choicefield: https://django-formset.fly.dev/selectize/#usage-with-dynamic-number-of-choices How about nonmodel based dynamic choices ?
something like: