Code

Opened 5 years ago

Closed 5 years ago

#9949 closed (duplicate)

When using named groups for choices, filter list in admin shows object data.

Reported by: matt@… Owned by: nobody
Component: contrib.admin Version: master
Severity: Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

I tested this against both 1.0.2 and SVN-9694
Code:

MEDIA_CHOICES = (
    ('Audio', (
            (1, 'Vinyl'),
            (2, 'CD'),
        )
    ),
    ('Video', (
            (3, 'VHS Tape'),
            (4, 'DVD'),
        )
    ),
)

class Media(models.Model):
    user  = models.ForeignKey(User)
    media = models.IntegerField(choices=CHOICES_MEDIA)

See attached file for what is displayed.

Attachments (1)

Picture 2.png (16.3 KB) - added by anonymous 5 years ago.

Download all attachments as: .zip

Change History (4)

Changed 5 years ago by anonymous

comment:1 Changed 5 years ago by matt@…

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

Using python 2.6.1

comment:2 Changed 5 years ago by anonymous

Values in MEDIA_CHOICES are wrapped in ugettext_lazy('Vinyl')

comment:3 Changed 5 years ago by ramiro

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

Duplicate of #9954 that includes a patch. I've tested the case you posted (wrapping one or more lables with ugettext_lazy()) and it's fixed when that patch is applied.

Sorry I didn't associate both reports but the report wasn't very clear.

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.