Re: Get request, has PK, how do I access the PK data with in the model

2018-01-29 Thread Andréas Kühne
Hi, No, year__in should be for a list. For example you can write: Profile.objects.filter(year__in=[2017, 2016, 2015]) so in your case it would be Profile.objects.filter(year=user.birthday.year) You should checkout how selection works in the django documentation:

Re: Get request, has PK, how do I access the PK data with in the model

2018-01-29 Thread Travis Pickle
Hiya -- Thanks. This is sort of what I was looking for. user = User.objects.get(pk=pk) cars = Car.objects.filter(year=user.birthday.year).all() UserRelatedProfiles or user_related_profiles = Profile.objects.filter(year__in=user.birthday.year) ? On Monday, January 29, 2018 at 8:40:13 AM UTC-5,

Re: Get request, has PK, how do I access the PK data with in the model

2018-01-29 Thread Andréas Kühne
Hi, It's really hard to understand what you exactly want. Without showing your code it'll be even harder to understand how / what you want to do. We have to guess from the little information you are giving However. if you want to query cars with the same year as the user for example, you

Re: Get request, has PK, how do I access the PK data with in the model

2018-01-29 Thread Travis Pickle
I'm assuming not a single person has read what is in my body of my message and has only read the subject. I know bots have read the body. if http://somesite.com/user/ *1 ,where 1 is the pk,* i want to use in the view pk relation to gather all fields, and use fields

Re: Get request, has PK, how do I access the PK data with in the model

2018-01-29 Thread Daniel Roseman
On Sunday, 28 January 2018 19:01:35 UTC, Travis Pickle wrote: > > I am using django 1.8. > > I read though the docs, however, i not seeing how I can get the PK other > attributes to use in model searching. > As others have stated, this is *fully* covered in the tutorial, specifically in part

Re: Get request, has PK, how do I access the PK data with in the model

2018-01-28 Thread Travis Pickle
I am using django 1.8. I read though the docs, however, i not seeing how I can get the PK other attributes to use in model searching. On Saturday, January 27, 2018 at 3:47:05 PM UTC-5, Matemática A3K wrote: > > https://docs.djangoproject.com/en/2.0/intro/tutorial01/ > > On Sat, Jan 27, 2018 at

Re: Get request, has PK, how do I access the PK data with in the model

2018-01-27 Thread Matemática A3K
https://docs.djangoproject.com/en/2.0/intro/tutorial01/ On Sat, Jan 27, 2018 at 8:19 AM, Travis Pickle wrote: > Andy, > > Do you have a link for this? Thanks > > -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To

Re: Get request, has PK, how do I access the PK data with in the model

2018-01-27 Thread Travis Pickle
Andy, Do you have a link for 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,

Re: Get request, has PK, how do I access the PK data with in the model

2018-01-26 Thread Andy
Travis have a look the very cool and complete django tutorial which explaining how you query models in part2. Once you have create the admin views, watch closely at how the list filters work to get an idea of what you have to do. :) -- You received this message because you are subscribed to

Get request, has PK, how do I access the PK data with in the model

2018-01-25 Thread Travis Pickle
Lets say I have a model called Users. I request(get) http://www.google.com/user/*id* * (pk)* The users has age but finds to find other users with in same range, as well as other items that might be different ages. Lets say I want to find similar interest for