Opened 16 years ago

Closed 16 years ago

#10303 closed (fixed)

Contradiction in updating-multiple-objects-at-once doc?

Reported by: gluckj Owned by: nobody
Component: Documentation Version: dev
Severity: Keywords: updating-multiple-objects-at-once
Cc: Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

Hi,

I was reading http://docs.djangoproject.com/en/dev/topics/db/queries/#updating-multiple-objects-at-once just now.

It first says:
"You can only set non-relation fields and ForeignKey fields using this method, and the value you set the field to must be a hard-coded Python value (i.e., you can't set a field to be equal to some other field at the moment)."

But later says:
"Calls to update can also use F() objects to update one field based on the value of another field in the model."

Is this a contradiction?

(Thanks, BTW, for your awesome documentation -- I'm really enjoying it!)

-- jg

Change History (2)

comment:1 by Russell Keith-Magee, 16 years ago

Triage Stage: UnreviewedAccepted

Yes, this is a contradiction. The F() syntax is a relatively recent addition, and when I added the documentation for F(), I didn't remove the old note about only using hard-coded values. I'll update the docs.

comment:2 by Russell Keith-Magee, 16 years ago

Resolution: fixed
Status: newclosed

(In [9846]) Fixed #10303 -- Corrected a contradiction in the docs regarding the capabilities of the .update() clause that was introduced by the documentation for F() expressions. Thanks to gluckj for the report.

Note: See TracTickets for help on using tickets.
Back to Top