Python Django聚合转义unicode字符串?

Python Django聚合转义unicode字符串?,python,django,unicode,django-aggregation,Python,Django,Unicode,Django Aggregation,我尝试在带有unicode文本的数据库上使用聚合,它显示了另一次编码为unicode字符的unicode对象。聚合后如何显示unicode文本 >>> from apps.person.models import Person >>> from django.db.models import Min >>> for p in Person.objects.all()[:1]: print(p.full_name) ... 15 чоловік

我尝试在带有unicode文本的数据库上使用聚合,它显示了另一次编码为unicode字符的unicode对象。聚合后如何显示unicode文本

>>> from apps.person.models import Person
>>> from django.db.models import Min
>>> for p in Person.objects.all()[:1]: print(p.full_name)
...
15 чоловік
>>> Person.objects.aggregate(Min('full_name'))
{'full_name__min': u'15 \u0447\u043e\u043b\u043e\u0432\u0456\u043a'}

这里没有特定于聚合的内容。在第一行中,您调用print,但在第二行中,您只是让shell输出聚合调用的结果,聚合调用始终使用repr格式。这将有助于:

result = Person.objects.aggregate(Min('full_name'))
print result['full_name__min']