Code

Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#12120 closed (invalid)

documentation: get() does not work with values()

Reported by: adrian_nye Owned by: nobody
Component: Documentation Version: 1.1
Severity: Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

Under get() and values() in the queryset documentation, it does not mention that these two do not work together. It would be good to mention
this under values() along with the workaround using filter() instead of get().

Attachments (0)

Change History (2)

comment:1 Changed 4 years ago by Alex

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Resolution set to invalid
  • Status changed from new to closed

The docs state quite clearly that get() doesn't return a QuerySet, since values() is a method on queryset it's self-evident that get().values() wouldn't work.

comment:2 Changed 4 years ago by apollo13

And about your workaround, you wouldn't use filter but this:

.values().get()

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.