Re: how to pass the ID of a slected item in a list to ORM

2018-06-22 Thread Gerald Brown

Thanks for the reply.


On Tuesday, 19 June, 2018 04:17 AM, C. Kirby wrote:

Yes

On Friday, June 15, 2018 at 10:07:01 PM UTC-4, Gerald Brown wrote:

When I inspect the object in Firefox that is what it looks like
because it is generated by Django. Does the user have to select an
item and then submit it in order for me to get the ID?

Thanks.


On Friday, 15 June, 2018 10:29 PM, C. Kirby wrote:

So you have a
|

A
|B
|||C

||
|

If you make your option tags look like
|
{{person.name
}}
|

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 django-users...@googlegroups.com .
To post to this group, send email to django...@googlegroups.com
.
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
.


--
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 django-users+unsubscr...@googlegroups.com 
.
To post to this group, send email to django-users@googlegroups.com 
.

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/d7e93f6a-e3bd-40eb-8d3b-bc74f9358347%40googlegroups.com 
.

For more options, visit https://groups.google.com/d/optout.


--
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 django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
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/9a113717-f500-b70b-adbe-228b508d5470%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: how to pass the ID of a slected item in a list to ORM

2018-06-18 Thread C. Kirby
Yes

On Friday, June 15, 2018 at 10:07:01 PM UTC-4, Gerald Brown wrote:
>
> When I inspect the object in Firefox that is what it looks like because it 
> is generated by Django. Does the user have to select an item and then 
> submit it in order for me to get the ID?
>
> Thanks.
>
> On Friday, 15 June, 2018 10:29 PM, C. Kirby wrote:
>
> So you have a 
> 
>   A
>   B
>   C
> 
>
> If you make your option tags look like
> {{person.name}}
>
> 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 django-users...@googlegroups.com .
> To post to this group, send email to django...@googlegroups.com 
> .
> 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.
>
>
>

-- 
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 django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
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/d7e93f6a-e3bd-40eb-8d3b-bc74f9358347%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: how to pass the ID of a slected item in a list to ORM

2018-06-15 Thread Gerald Brown
When I inspect the object in Firefox that is what it looks like because 
it is generated by Django. Does the user have to select an item and then 
submit it in order for me to get the ID?


Thanks.


On Friday, 15 June, 2018 10:29 PM, C. Kirby wrote:

So you have a
|

A
|B
|||C

||
|

If you make your option tags look like
|
{{person.name}}
|

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 django-users+unsubscr...@googlegroups.com 
.
To post to this group, send email to django-users@googlegroups.com 
.

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.


--
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 django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
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/11e7c90f-4305-3062-1d2e-c0f49f97d81d%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: how to pass the ID of a slected item in a list to ORM

2018-06-15 Thread Gerald Brown

The ID is an integer as it is the ID for the table. The name is a VARCHAR.

I have had this same problem in the past with other programming 
languages.  How to get my head around how to get the ID for a selected item.



On Friday, 15 June, 2018 10:09 PM, Anthony Anonde wrote:

Sorry your question is a bit complicated, you have a form that contains a list 
of names and id, what data types are they contain in? Understand how the list 
box is structured will help to give you a better ans



--
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 django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
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/9d61cf55-43b1-a7ac-2a87-894227cf4b91%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: how to pass the ID of a slected item in a list to ORM

2018-06-15 Thread C. Kirby
So you have a 

  A
  B
  C


If you make your option tags look like
{{person.name}}

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 django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
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.


Re: how to pass the ID of a slected item in a list to ORM

2018-06-15 Thread Anthony Anonde
Sorry your question is a bit complicated, you have a form that contains a list 
of names and id, what data types are they contain in? Understand how the list 
box is structured will help to give you a better ans

-- 
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 django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
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/b4131227-2319-4cb7-973c-40e8ae41b46f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


how to pass the ID of a slected item in a list to ORM

2018-06-15 Thread Gerald Brown
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 django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
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/12b0da2c-359c-4da2-ac13-9e627a91c12d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.