Opened 8 years ago

Closed 3 years ago

#10293 closed New feature (duplicate)

Show Unicode representations next to ManyToMany raw_id_field

Reported by: joaoolavo Owned by: nobody
Component: contrib.admin Version: 1.0
Severity: Normal Keywords: raw_id_field, manytomanyfield, manytomanyrawidwidget, unicode representation
Cc: carlos.palol@…, stan@… Triage Stage: Design decision needed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: yes


Here's what's necessary to be changed to show the Unicode strings of the related objects next to a ManyToMany raw_id_field. Inside file django/contrib/admin/, change the method label_for_value() of class ManyToManyRawIdWidget to this one:

def label_for_value(self, value):
        value = [int(v) for v in value.split(',')]
        objs =
        return '&nbsp;<strong>%s</strong>' % ',&nbsp;'.join(truncate_words(obj, 14) for obj in objs)

Attachments (1)

m2m_raw_id_field_improvement.patch (553 bytes) - added by joaoolavo@… 7 years ago.
Patch with the improvement

Download all attachments as: .zip

Change History (8)

comment:1 Changed 8 years ago by jacob

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Triage Stage changed from Unreviewed to Design decision needed

Can you please provide this change as a real patch? See the contributing documentation if you need help generating a patch.

Changed 7 years ago by joaoolavo@…

Patch with the improvement

comment:2 Changed 5 years ago by SmileyChris

  • Severity set to Normal
  • Type set to New feature

comment:3 Changed 5 years ago by julien

  • UI/UX set

comment:4 Changed 5 years ago by julien

  • Easy pickings unset

See also #7028 re: improving the raw_id_fields widget UI.

comment:5 Changed 5 years ago by carlospalol

  • Cc carlos.palol@… added

comment:6 Changed 5 years ago by Stanislas <stan@…>

  • Cc stan@… added

I have merged this patch in #7028.

comment:7 Changed 3 years ago by jacob

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

Closing as dup of #7028.

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