1. def communityClass(request):
    2. com = request.GET.get('com')
    3. result = campmodel.CommunityInfo.objects.filter(
    4. com=com).order_by("-time")[:10]
    5. data = []
    6. for i in result:
    7. data.append({"id": i.id, "time": str(i.time), "title": i.title,
    8. "content": i.content, "picture": str(i.picture)})
    9. return HttpResponse(json.dumps(data))

    image.png