On Fri, Mar 26, 2010 at 4:31 PM, Asim Yuksel <a.sinanyuk...@gmail.com>wrote:
> here is the list display > > > http://picasaweb.google.com/110428031719333287170/BaslKsZAlbum#5453042316004332754 > > I want that to appear in a list display, because that is what the > client wants :) > > I tried writing unicode method , but it has no effect.I dont know > why. > Since you haven't shown exactly what you tried there, we don't know either. As documented here: http://docs.djangoproject.com/en/dev/ref/contrib/admin/#django.contrib.admin.ModelAdmin.list_display if the field is a ForeignKey, Django will display the __unicode__() of the related object. Thus if your Tblmaphds model had a __unicode__ method, whatever it returned would be what you see instead of "Tblmaphds object" in list display. Adding a __unicode__ method to that model is the easiest way to accomplish what you are asking for. There are also other options, as noted in that doc you can define callables on your model or model admin that return whatever you'd like to be shown in the list display, but really the easiest thing here would be the __unicode__ method on that model, so I'd suggest you try to figure out why that easiest solution isn't working before trying other more complicated things. Karen -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@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.