Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save domenicomonaco/713736 to your computer and use it in GitHub Desktop.

Select an option

Save domenicomonaco/713736 to your computer and use it in GitHub Desktop.
def __unTypeError: coercing to Unicode: need string or buffer, long foundicode__(self):
Errore:
in Admin o any other query to models
TypeError: coercing to Unicode: need string or buffer, long found
solution:
da
def __unicode__(self):
return self.id
a
def __unicode__(self):
return unicode(self.id)
@scarletsky
Copy link

what is the different between da and a (line8 and line 12)?

I found return unicode(self.id) can resolve this problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment