Code

Opened 8 years ago

Closed 8 years ago

#2321 closed defect (invalid)

list_display_links (tuple)

Reported by: patrick@… Owned by: adrian
Component: contrib.admin 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

list_display_links = ('title',) works
list_display_links = ('title') does not work

referring to the django-documentation, the final comma should not be necessary
btw: I´m using revision 3309

Attachments (0)

Change History (1)

comment:1 Changed 8 years ago by mtredinnick

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

list_display_links takes a sequence as its argument (just like list_display_filter). I think this is fairly clear from the examples.

In Python ('title') is just a string, whereas ('title',) is a 1-tuple. So the former is not expected to work. If you don't like the trailing comma, ['title'] will also work.

I can't see anywhere in the documentation that we are using the incorrect ('title') format, but, if so, please reopen with a pointer to the place.

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.