Opened 5 years ago

Closed 5 years ago

#13143 closed (invalid)

filter_horizontal & filter_vertical widgets does not work if verbose_name contains non-ascii characters

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

Description

filter_horizontal & filter_vertical widgets does not work if verbose_name contains non-ascii (or maybe Turkish, I'm not sure) characters.

Doesn't work

class SomeModel(models.Model):
    name = models.CharField(max_length=30)
    books = models.ManyToManyField(SomeOtherModel, verbose_name='this does not work -- şüğöç')

Does work

class SomeModel(models.Model):
    name = models.CharField(max_length=30)
    books = models.ManyToManyField(SomeOtherModel, verbose_name='this works')

Change History (1)

comment:1 Changed 5 years ago by russellm

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

This is an unusual presentation, but the issue here is that you have non-ascii characters in a bytestring. Make verbose_name a unicode string and give your models.py file a PEP-263 encoding, and your example works fine.

Note: See TracTickets for help on using tickets.
Back to Top