Code

Opened 9 years ago

Closed 8 years ago

Last modified 7 years ago

#532 closed defect (invalid)

get_values doesn't work with the "select" lookup

Reported by: jacob Owned by: jacob
Component: Database layer (models, ORM) 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:

Description

You should be able to do:

    stories.get_values(fields=['pub_date', 'foo'], select={'foo':'SELECT COUNT(*) FROM auth_users'})

But that fails with a FieldDoesNotExist: 'foo' exception.

Attachments (0)

Change History (3)

comment:1 Changed 8 years ago by adrian

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

Closing this because we no longer have get_values() after magic-removal.

comment:2 Changed 8 years ago by James Bennett <ubernostrum@…>

Adrian, we do have values and extra, though, which provide the same feature.

If someone can replicate this behavior on current trunk by doing something like

Story.objects.values(fields=['pub_date', 'foo']).extra(select={'foo': 'SELECT COUNT(*) FROM auth_users'})

this should probably be reopened.

comment:3 Changed 7 years ago by Honza Král <Honza.Kral@…>

Ooops, I just opened a new ticket for this (patch included)
see #3050

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.