Re: Re: Error with filter queryset

2020-02-09 Thread maninder singh Kumar
have you tried "OneToOneField" ? I am wondering about a many to one field to User [image: --] Maninder Kumar [image: http://]about.me/maninder.s.kumar On Mon, Feb 10, 2020 at 12:01 AM BRAJESH KUMAR wrote: > I have a local host website work

RE: Re: Error with filter queryset

2020-02-09 Thread BRAJESH KUMAR
I have a local host website working with some page showing few details of one of many products with a data associated for usage like zoom car rental. Facing issues while trying to add a counter and have it updated by day. Eg: if I have a product a available 10 units for next 10 days and it gets boo

Re: Error with filter queryset

2020-02-09 Thread Chucky Mada Madamombe
Thanks Farai! Regards Chuck G. Madamombe NAM: +264 81 842 1284 RSA: +27 78 208 7034 Twitter: @chuckygari Skype: chuckygari Facebook: Chucky Mada Madamombe LinkedIn: Chucknorris Garikayi Madamombe On Sun, 9 Feb 2020, 18:14 Farai M wrote: > The status is a foreign ID u can use choices if the sta

Re: Error with filter queryset

2020-02-09 Thread Chucky Mada Madamombe
Antje, Thanks very much for your help! Regards Chuck G. Madamombe NAM: +264 81 842 1284 RSA: +27 78 208 7034 Twitter: @chuckygari Skype: chuckygari Facebook: Chucky Mada Madamombe LinkedIn: Chucknorris Garikayi Madamombe On Sun, 9 Feb 2020, 15:25 Antje Kazimiers wrote: > Hi Chuck, > > Status

Re: Error with filter queryset

2020-02-09 Thread Farai M
The status is a foreign ID u can use choices if the status is not dynamically changed by the users . Otherwise you will need to pass the selected status from fronted or hardcode it. On Sun, Feb 9, 2020, 2:58 PM Chuck G. Madamombe wrote: > Hello, > > I want to filter data in the database to retri

Re: Error with filter queryset

2020-02-09 Thread Antje Kazimiers
Hi Chuck, Status in your example is not a text field, but a Foreign Key, that means a reference to a record in another table Task_Status, you see that here: Status = models.ForeignKey(Task_Status, on_delete=models.CASCADE) You need to filter on the attribute within Task_Status, which has the

Error with filter queryset

2020-02-09 Thread Chuck G. Madamombe
Hello, I want to filter data in the database to retrieve only those tasks with status='In progress'. I have used the filter queryset, but am getting an error. Please help. *Here is my view (Filter tasks by their status):* def tasks_in_progress(request): tasks = Task.objects.filter(Status='