Re: iterate through list

2020-02-14 Thread Kai Kobschätzki
Thanks for the tip, I will read it :) Greetings bengoshi On 2/14/20 2:31 PM, Roger Gammans wrote: > No problem, > > It 's all explained here : > https://docs.djangoproject.com/en/3.0/ref/models/querysets/ > > > On Fri, 2020-02-14 at 14:27 +0100, Kai Kobschätzki wrote: >> Hi Roger: >> >> Thanks

Re: iterate through list

2020-02-14 Thread Roger Gammans
No problem, It 's all explained here : https://docs.djangoproject.com/en/3.0/ref/models/querysets/ On Fri, 2020-02-14 at 14:27 +0100, Kai Kobschätzki wrote: > Hi Roger: > > Thanks a lot! Such as easy :) > > Greetings > > bengoshi > > > On 2/14/20 2:15 PM, Roger Gammans wrote: > > Use: > >

Re: iterate through list

2020-02-14 Thread Kai Kobschätzki
Hi Roger: Thanks a lot! Such as easy :) Greetings bengoshi On 2/14/20 2:15 PM, Roger Gammans wrote: > Use: > > for data in Journal.objects.all(): > > > > > On Fri, 2020-02-14 at 14:13 +0100, Kai Kobschätzki wrote: >> Hi: >> >> I want to do something with the content of a table. Prob

Re: iterate through list

2020-02-14 Thread Roger Gammans
Use: for data in Journal.objects.all(): On Fri, 2020-02-14 at 14:13 +0100, Kai Kobschätzki wrote: > Hi: > > I want to do something with the content of a table. Problem is, that > the > IDs are not continuous. I tried: > > import .models from Journal > > last = Journal.obejects.l

iterate through list

2020-02-14 Thread Kai Kobschätzki
Hi: I want to do something with the content of a table. Problem is, that the IDs are not continuous. I tried: import .models from Journal last = Journal.obejects.last() last += 1 for i in range(last):   try:     data = Journal.objects.get(pk=i)     doing something with this data   except:     pa