Displaying the model's__unicode__ in django admin

Viewed 12880

I would like to display the model's username in Django Admin interface but not very sure how to do it..

The models.py:

    class Adult(models.Model):    
        user = models.OneToOneField(User)
        fullname = models.CharField(max_length=100,
                                    blank=True)
        def __unicode__(self):
            return self.user.username

Admin.py:

    class AdultAdmin(admin.ModelAdmin):
        list_display = ('??', 'Student_Name',)
        search_fields = ['??',]

    admin.site.register(Adult, AdultAdmin)

What should go inside the ?? above ? I would like to display the unicode or the self.user.username? How do i do it? Need some guidance...

1 Answers
Related