this should solve your issue and simplify your code a little bit:
def render_his(self, value):
return (', ').join(list(value.all()))
or
def render_his(self, value):
return (', ').join([x.name for x in value.all()])
if you want a specific attribute instead of the unicode
representation of your Hi
objects.
You are getting the error because value
is a ManyToManyField
instance, not a Hello
instance.