Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#2064 closed enhancement (fixed)

Need documentation for low-level API for writing your own SQL

Reported by: Simon Willison Owned by: jacob
Component: Documentation Version:
Severity: normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:


The Django database documentation doesn't currently describe the low-level API for writing your own SQL, using django.db.connection, cursors and so on. (It does explain the extra() clause on QuerySets which covers 80% of cases). Documentation for this should demonstrate writing custom model methods that run their own SQL queries, thus encouraging best practises.

Attachments (0)

Change History (2)

comment:1 Changed 8 years ago by adrian

The model docs have it here:

This is a bit confusing, because the database API docs should point this out as well. I'll make the addition.

comment:2 Changed 8 years ago by adrian

  • Resolution set to fixed
  • Status changed from new to closed

(In [3054]) Fixed #2064 -- Added 'Falling back to raw SQL' section to docs/db-api.txt

Add Comment

Modify Ticket

Change Properties
<Author field>
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'

E-mail address and user name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.