Re: mass-updating question

2009-08-13 Thread Jonas Obrist
Alex Gaynor wrote: > On Thu, Aug 13, 2009 at 2:51 PM, Jonas Obrist wrote: > >> Hi django-users >> >> I try to do as much as I can in ORM without python looping etc. So I >> wonder if the following code could be done in one update: >> >> for parent in thread.forum.allparents.all(): >>parent.

Re: mass-updating question

2009-08-13 Thread Alex Gaynor
On Thu, Aug 13, 2009 at 2:51 PM, Jonas Obrist wrote: > > Hi django-users > > I try to do as much as I can in ORM without python looping etc. So I > wonder if the following code could be done in one update: > > for parent in thread.forum.allparents.all(): >    parent.postcount += 1 >    parent.last

mass-updating question

2009-08-13 Thread Jonas Obrist
Hi django-users I try to do as much as I can in ORM without python looping etc. So I wonder if the following code could be done in one update: for parent in thread.forum.allparents.all(): parent.postcount += 1 parent.lastpost = post parent.save() Basically do something like: threa