1
__unicode__()
must always return a string or unicode. Party.__unicode__()
does not. To fix, convert the returned value explicitly to string: return str(self.PartyID)
0
Add method like this.
def __unicode__(self):
return u"%i" % self.CheckOutID
The documentation says:
The unicode() method is called whenever you call unicode() on an object. Since Django’s database backends will return Unicode strings in your model’s attributes, you would normally want to write a unicode() method for your model.
- Divide queryset on 'read' / 'unread' in Django
- How to put default avatar for a user
- Pass Django Model Object into Template Tag
- Django 1.10: Error Installing django_debug_toolbar
- How to have multiple types of users in separated tables?
Source:stackexchange.com