On 7/14/07, Steven Hilton <[EMAIL PROTECTED]> wrote:
> When foo.level drops to zero, I need to flip bar.switch like so...
>
> update bar set switch = 0 where foo_id = foo.id and switch = 1
>
> I could be updating any number of rows in bar. I want to do this
> without do a select on bar.
>
> Do I need to drop to raw sql, or have I missed this part of the Django
> documentation?

if it is absolutely necessary to avoid doing a select on the second
table, then you will need to use SQL. If it is not absolutely
necessary to avoid a select on the second table, then a couple of
lines of logic in the save() method of the 'foo' class would be all
you need.


-- 
"Bureaucrat Conrad, you are technically correct -- the best kind of correct."

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to