So you have a
<select>
<option>A</option>
<option>B</option>
<option>C</option>
</select>
If you make your option tags look like
<option value="{{person.person_id}}">{{person.name}}</option>
The submitted value for the field will be the patient_id, which you then
use in your filter statement.
On Friday, June 15, 2018 at 8:46:53 AM UTC-4, Gerald Brown wrote:
>
> Greetings:
>
> I have a form with a listbox that has people's names and their ID from the
> database. I am trying to get the ID from that list for the selected person
> so I can use it in ORM statements: I.E. v1 = Visit.objects.filter(person_id
> = ??) where ?? is the ID from the select list.
>
> Has anyone had any experience on how I can accomplish this?
>
> Thanks.
>
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-users/bd054ed4-8761-415d-adaf-07bfc144956d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.