I think value is a list in that case, of the primary keys, but the best way to find out is through expirementation, have that method return nothing but a string representation of value and look at that page, or use some other form of logging, once you know what it is you can make it do just what you want.
Yeap, value is actually a list of large integers. But in none variable come an object that allows me access the related objects.
In a ForeignKeyRawIdWidget, there's
the object self.rel (of type django.db.models.fields.related.manytoonerel), which has the method get_related_field() that helps to bring the related object unicode representation.
But in a ManyToManyRawIdWidget, the object self.rel's type is a django.db.models.fields.related.manytomanyrel, which doesn't have such method! Check the result of the command 'dir(self.rel)':
['__class__', '__delattr__', '__dict__', '__doc__', '__getattribute__', '__hash__', '__init__', '__module__', '__new__', '__reduce__', '__reduce_ex__', '__repr__',
'__setattr__', '__str__', '__weakref__', 'limit_choices_to', 'multiple', 'related_name', 'symmetrical', 'through', 'to']
And the result of the command 'self.rel.__dict__':
{'limit_choices_to': {}, 'related_name': None, 'multiple': True, 'to': <class PROJECT_NAME.APP_NAME.models.RELATED_MODEL_NAME="">, 'through': None, 'symmetrical': True}</class>
It's a bit weird this <class> tag...
Is there a way out?
Thanks!!