1👍
✅
The full traceback would have been useful.
I expect the problem comes from the related_name
attribute in your people
field. You’ve marked this for translation, but that makes no sense: this is an attribute you use in your code, not something for public consumption. Take out the _()
call.
0👍
photo
is object, but you want get this as str
:
return u'<img src="%s" /> - %s - %s' % (self.photo, self.description, self.people )
You need url
attr:
return u'<img src="%s" /> - %s - %s' % (self.photo.url, self.description, self.people )
My solution about people
:
people = models.ManyToManyField(PersonModel, related_name = _('Persons'), verbose_name=_('Person'))
- [Answer]-How yo query a string with an ObjectID in subquery
- [Answer]-Django User model extended for employee. How to access the employee attribute in change_form of model admin?
- [Answer]-Cloudsql and datastore combined together with django
Source:stackexchange.com