Code

Opened 3 years ago

Closed 3 years ago

Last modified 3 years ago

#16293 closed New feature (fixed)

Patch database documentation to explain how to return fetchall() as a dict rather than list.

Reported by: foxwhisper Owned by: nobody
Component: Documentation Version: 1.3
Severity: Normal Keywords:
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: yes Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

Full discussion about this topic can be found in:

http://groups.google.com/group/django-developers/browse_thread/thread/72c91698cba2ea5b

So far we have +2 votes and -1 vote.

-1 vote:

The thing is, this is a DB API snippet, not a Django snippet 
specifically.  If Django were a DB API toolbox, then it might make 
sense to include it in some form or other.  But it's not, so in the 
interest of keeping things relatively tidy I'm a -0 on this. 

+2 vote:

It is often said here that Django ORM is designed to do 80% of the 
stuff, the rest can be done using raw SQL. So, giving pointers to 
users how to perform the raw SQL as painlessly as possible is 
something Django documentation should do. 

Could we get some more feedback on this??

Cal

Attachments (1)

16293-1.patch (1.2 KB) - added by foxwhisper 3 years ago.

Download all attachments as: .zip

Change History (7)

comment:1 Changed 3 years ago by brillgen

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset

+1 - I don't personally have a need for this particular case yet, however I would support having more documentation as long as it met the quality and style guidelines of the project.

Django does provide and mention a way of getting raw db access, this documentation makes sense to put there. It couldn't really hurt.

comment:2 Changed 3 years ago by jacob

  • Triage Stage changed from Unreviewed to Accepted

There's almost never a reason not to add something to the docs as long as its done in a sensible way. Cal, can you work up a patch with some suggested language and find a good place to work it in?

comment:3 Changed 3 years ago by jacob

  • Type changed from Uncategorized to New feature

Changed 3 years ago by foxwhisper

comment:4 Changed 3 years ago by foxwhisper

  • Has patch set
  • Needs tests set

Patched, could someone please verify if this is suitable?

comment:5 Changed 3 years ago by ubernostrum

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

In [16808]:

Fixed #16293: Document a way to return dicts with column names from a DB cursor.

comment:6 Changed 3 years ago by ubernostrum

In [16809]:

[1.3.X] Fixed #16293: Document a way to return dicts with column names from a DB cursor. Backport of [16808] from trunk.

Add Comment

Modify Ticket

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


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

 
Note: See TracTickets for help on using tickets.