Opened 15 years ago

Closed 15 years ago

Last modified 13 years ago

#12519 closed (fixed)

Incorrect Documentation for Model.objects.raw()

Reported by: boralyl Owned by: nobody
Component: Documentation Version: dev
Severity: Keywords: raw, sql, orm, models, db
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

The first example under the Performing Raw Queries section (http://docs.djangoproject.com/en/dev/topics/db/sql/#django.db.models.Manager.raw) has an example of a simple model and then using the raw method of the model's objects. The example shows the result of printing the raw query as what looks like queryset results. In actuality the raw query is just printed back to the screen using the repr method. To execute the query it must be iterated over. The example makes it appear the RawQuerySet functions just like a QuerySet does when it is printed(query executed), which it does not.

It may be that this has not yet been implemented yet, and the documentation is for the final version, but just in case I figured I'd file this ticket.

Attachments (1)

rawqueryset-example-doc.diff (808 bytes ) - added by eculver 15 years ago.
Update example to show that Manager.raw() returns RawQuerySet instance.

Download all attachments as: .zip

Change History (5)

by eculver, 15 years ago

Update example to show that Manager.raw() returns RawQuerySet instance.

comment:1 by eculver, 15 years ago

Has patch: set

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

Triage Stage: UnreviewedAccepted

comment:3 by Russell Keith-Magee, 15 years ago

Resolution: fixed
Status: newclosed

(In [12561]) Fixed #12519 -- Corrected documentation on .raw() queries. Thanks to boralyl for the report and patch.

comment:4 by Jacob, 13 years ago

milestone: 1.2

Milestone 1.2 deleted

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