Duplicate django query set?

Posted by Piotr Czapla on Stack Overflow See other posts from Stack Overflow or by Piotr Czapla
Published on 2009-07-23T07:37:58Z Indexed on 2010/03/27 14:03 UTC
Read the original article Hit count: 296

Filed under:
|
|

I have a simple django's query set like:

qs = AModel.objects.exclude(state="F").order_by("order")

I'd like to use it as follows:

qs[0:3].update(state='F')
expected = qs[3] # throws error here

But last statement throws: "Cannot update a query once a slice has been taken."

How can I duplicate the query set?

© Stack Overflow or respective owner

Related posts about django-models

Related posts about django