How to show raw_id value of a ManyToMany relation in the Django admin?
Posted
by luc
on Stack Overflow
See other posts from Stack Overflow
or by luc
Published on 2010-05-11T08:36:03Z
Indexed on
2010/06/08
11:32 UTC
Read the original article
Hit count: 211
Hello,
I have an app using raw_id on both ForeignKeyField and ManyToManyField. The admin displays the value of the foreign key on the right of the edit box.
Unfortunatey, it doesn't work with ManyToMany. I've checked the code and I think that it is the normal behavior. However I would like to know if someone has an easy tip to change this behavior?
Thanks in advance
Update: I've tried to subclass the ManyToManyRawIdWidget but I don't know how to say that the raw_id_fields should use my custom widget. formfield_overrides doesn't seem to work with raw_id fields
© Stack Overflow or respective owner