Re: update query set with a limit

2010-02-27 Thread James Bennett
On Sat, Feb 27, 2010 at 10:07 PM, Harley Bussell wrote: > Hi, id like to know if any one has found a work around to use limits > when updating a query set. This is unlikely to be supported by Django; "UPDATE ... LIMIT" is non-standard, non-portable and MySQL is the only DB supporting it out of th

update query set with a limit

2010-02-27 Thread Harley Bussell
Hi, id like to know if any one has found a work around to use limits when updating a query set. I'm trying to lock a number of the oldest rows in a table. update job set lock='lockid' where lock ='' order by created limit 10; Ideally id like to do something like this: Job.objects.filter(lock='').