Code

Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#1532 closed defect (fixed)

[patch] [magic-removal] select arg for QuerySet.extra() should be a dict

Reported by: anonymous Owned by: adrian
Component: Database layer (models, ORM) Version:
Severity: normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

According to the 0.91 docs, this should work:

MyObject.objects.extra(
    select={
        'my_new_attr': 'select count(*) from ...'
    }
)

But new behavior seems to expect select to be a list of ('attribute_name', 'query') tuples. I don't see any particular reason for it to change, nor can I find any documentation on it. Anyone want to defend the current behavior before I patch it?

Attachments (1)

query_set_select.diff (1.0 KB) - added by jkocherhans 8 years ago.

Download all attachments as: .zip

Change History (3)

Changed 8 years ago by jkocherhans

comment:1 Changed 8 years ago by jkocherhans

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

(In [2560]) No comments so... fixed #1532.

comment:2 Changed 8 years ago by akaihola

This also fixed #1519, which should probably be closed.

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.