Ticket #12519: rawqueryset-example-doc.diff

File rawqueryset-example-doc.diff, 808 bytes (added by eculver, 14 years ago)

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

  • docs/topics/db/sql.txt

     
    2525
    2626.. method:: Manager.raw(raw_query, params=None, translations=None)
    2727
    28 This method method takes a raw SQL query, executes it, and returns model
    29 instances.
     28This method method takes a raw SQL query, executes it, and returns a
     29``RawQuerySet`` instance.
    3030
    3131This is best illustrated with an example. Suppose you've got the following model::
    3232
     
    3838You could then execute custom SQL like so::
    3939
    4040    >>> Person.objects.raw('SELECT * from myapp_person')
    41     [<Person: John Doe>, <Person: Jane Doe>, ...]
     41    <RawQuerySet: 'SELECT * from myapp_person'>
    4242
    4343.. admonition:: Model table names
    4444
Back to Top