Answer the question
In order to leave comments, you need to log in
How to implement search and select option in Django?
There is a web application. Implemented search by name and surname in the database. The results are displayed on the page.
How to get the ID of one of the options? Can I somehow pass from the function where the search was implemented or can I get it from the page?
task tracker. We search for implementers and add one or more to an existing project.
I decided to display the search result on the page first. Result brought out.
Now I do not know how to get the implementer ID to add to the M2M connection.
I hope this makes more
sense. Thank you.
Answer the question
In order to leave comments, you need to log in
Have you deduced a list of objects, and you need to get an ID for each? Through obj.pk does not come out? Or nada in a linked table via obj.name_set.pk?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question