0

I just want to pass a list which will look like this from views to form , FYI i'm using MultipleChoiceField

[('ad7d4d7c5fbd4678bafd9f2b93fdd4b5', 'Chandrayaan'), ('b55d7c02c29d4501b8d3f63053fef470', 'MOM'), ('b90a66ea9eb24d019102fadde900fdda', 'Galactica')]

i have another issue related to this question as well which i have posted already here

Divit Rao
  • 31
  • 5
  • 1
    Where do these options originate from? – Willem Van Onsem Sep 12 '21 at 16:33
  • 1
    Does this answer your question? [Creating a dynamic choice field](https://stackoverflow.com/questions/3419997/creating-a-dynamic-choice-field) – Abdul Aziz Barkat Sep 12 '21 at 16:47
  • @DivitRao: likely if these originate from a model, you can make use of a `ModelChoiceField`. – Willem Van Onsem Sep 12 '21 at 16:57
  • @WillemVanOnsem i did used `ModelChoiceField` but still it shows me 'Select a valid choice. *value* is not one of the available choices' [here](https://stackoverflow.com/questions/69149576/select-a-valid-choice-6da87c51321849bdb7da80990fdab19b-is-not-one-of-the-availa) – Divit Rao Sep 13 '21 at 06:21

0 Answers0