【发布时间】:2015-12-08 13:31:14
【问题描述】:
我需要从模型中提取最大日期。我在 y 查询集中使用聚合
fm = Codigo_Corto_Hist.objects.filter(codigo=cod).filter(estado=0).aggregate(Max('fecha_cambio'))
但我收到了一个字典 {'fecha': datetime.date(2015, 1, 1)},我只需要日期的值。
还有另一种获取值的方法,而不是字典,或者我如何从字典中提取值。
提前致谢
【问题讨论】:
-
my_dict["fecha"]? -
谢谢@JoranBeasley。我不熟悉字典。我想我需要阅读如何处理字典
标签: python django django-views django-queryset