Selecting Models by Typing an Identifier

7 views
Skip to first unread message

Derek Dong

unread,
May 28, 2019, 11:56:12 AM5/28/19
to Django users
I have two questions.
The first is: I want to select models in a form. The first is a standard User, the second is a Contest form already defined. Let's take the User as an example. I want to only have to type a string into the form, and have all users with that string as a substring of their username show up as options below, as a sort of autocomplete feature. Right now I have a model form where the model has User as a ForeignKey, but that requires clicking and finding a single user among a potential hundred.
My second question is:
As before, I also need to select a Contest. But in a single inputting session, I will be inputting many forms for a single Contest, so I want to select it only once, and after that it automatically fills in the last contest filled in. Is this possible?
Thanks
Reply all
Reply to author
Forward
0 new messages