模型.py
class ReportPerson(models.Model):
report = models.ForeignKey(Report)
name = models.CharField('Name', max_length=100)
视图.py
def method(request):
involver_namelist = []
involved = ReportPerson.objects.filter(report=report)
for involve in involved:
involver_name =involve.name
involver_namelist.append(involver_name)
print involver_namelist
return render
如果我从involver_namelist 打印数据,它会像这样打印,[u'Admin', u'Admin', u'Admin', u'Admin', u'Admin']
但我想要这样的输出Admin, Admin, Admin, Admin, Admin
。在django 中是否可能。