Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Can't convert 'Name' object to str implicitly
- Request Method: POST
- Request URL: http://127.0.0.1:8000/admin/display/nation/add/
- Django Version: 1.6.2
- Exception Type: TypeError
- Exception Value: Can't convert 'Name' object to str implicitly
- Exception Location: models.py in __unicode__, line 24
- class Name(models.Model):
- def __unicode__(self):
- return 'Name: ' + self.name
- id = models.AutoField(primary_key=True)
- name = models.CharField(max_length=32)
- class Meta:
- db_table = 'name'
- class Nation(models.Model):
- def __unicode__(self):
- return 'Nation: ' + self.name
- id = models.AutoField(primary_key=True)
- name = models.ForeignKey(Name)
- flag_path = models.CharField(max_length=64)
- class Meta:
- db_table = 'nation'
- u'Name: ' + self.name
- u'Nation: ' + self.name
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement