Actually, there would be a real advantage to doing update in the
DB rather than instantiating the model, changing it, and saving it,
since sql update is a single transaction.  If that's what queryset
update does, then the only issue with your version is that you
needed two asterisks, passing "some_dictionary" as keyword
arguments.  (We know from the error message that update
doesn't take any positional arguments beyond self, but it
could take keyword arguments.)

The trouble is that I don't see update as a documented queryset
method at:
   
http://docs.djangoproject.com/en/1.1/ref/models/querysets/#ref-models-querysets

So I'd have to look at the code to see what it does.  Also, if it's
undocumented, it should probably be considered internal and
subject to change.  If you're seeing it documented somewhere,
I'd appreciate a url.  I guess that I could go look at the code, but
I've got a sneaking suspicion that that it's a worker method used
in the implementation of filter, exclude, etc.

So, the only way that I know to run a SQL UPDATE is with custom
SQL.  (I'm pretty sure that you can't do it with extra().)

Bill

On Fri, May 14, 2010 at 8:33 AM, zinckiwi <zinck...@gmail.com> wrote:
> On May 13, 6:48 pm, Bill Freeman <ke1g...@gmail.com> wrote:
>> Or you could be right.  I'm still not clear on the OP's intent.
>
> I suspect both would work, with my solution relying on a queryset
> containing a single object. Yours is cleaner!
>
> Regards
> Scott
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To post to this group, send email to django-us...@googlegroups.com.
> To unsubscribe from this group, send email to 
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/django-users?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to