On Tue, Feb 17, 2009 at 11:47 AM, Alex Gaynor <alex.gay...@gmail.com> wrote:
> 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!! -- João Olavo Baião de Vasconcelos Bacharel em Ciência da Computação Analista de Sistemas - Infraestrutura joaoolavo.wordpress.com --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---