Django auth.User in Admininterface: coercing to Unicode: need string or buffer, User found

前端 未结 1 1173
轻奢々
轻奢々 2021-01-05 15:38

I\'m pretty new to django. I try to use the auth.User object as a foreign key.

My model:

from django.contrib.auth.models import User

(...)

class En         


        
相关标签:
1条回答
  • 2021-01-05 16:21

    this should work and explain itself

    def __unicode__(self):
        return unicode(self.user)
    
    0 讨论(0)
提交回复
热议问题