|
@@ -198,8 +198,9 @@ class RecentMonthPestCount(GenericAPIView):
|
|
|
for k, v in result.items():
|
|
for k, v in result.items():
|
|
|
if k in insect_dict.keys():
|
|
if k in insect_dict.keys():
|
|
|
temp[insect_dict.get(k)] = v
|
|
temp[insect_dict.get(k)] = v
|
|
|
|
|
+ temp = sorted(temp.items(), key=lambda item: item[1], reverse=True)
|
|
|
data = {
|
|
data = {
|
|
|
- "pest": temp,
|
|
|
|
|
|
|
+ "pest": dict(temp),
|
|
|
"imgs": imgs[:10]
|
|
"imgs": imgs[:10]
|
|
|
}
|
|
}
|
|
|
return Response(data)
|
|
return Response(data)
|