Re: I can't print a queryset value.

2018-01-03 Thread 1351552...@qq.com
This will work: >>> for id in Review.objects.values_list('id',flat=True): ... print('ID:%d' % id) ... ID:1 ID:2 ID:3 ID:4 ID:5 ID:6 and i don't know what you say in ur problem2 wblueboat From: karlnaflnest Date: 2018-01-03 15:20 To: Django users Subject: I can't print a queryset va

Re: I can't print a queryset value.

2018-01-02 Thread James Schneider
My other problem is when using a queryset value in my method: This works: insert_to_db(id) But this does not: insert_to_db(id, result) Any help would be greatly appreciated :) What is the insert_to_db function? That's probably where your issue is. Without that code, there probably isn't

I can't print a queryset value.

2018-01-02 Thread karlnaflnest
I am trying to pass a queryset value as an argument to a method but it won't proceed; it shows no error. And I tried printing it like this: for id in Review.objects.values_list('id', flat=True): print("ID: " + id) Output: 1 However, it worked and looped when I changed it to this: for id in