def banner_list(request): # 序列化数据 banners = Banner.objects.all() serialize = BannerSerializer(banners, many=True) return restful.result(data=serialize.data)
def banner_list(request): """ 展示所有轮播图 """ banners = Banner.objects.all() # 序列化,即将外键等同时也查询出来。序列化为一个json数据 serialize = BannerSerializer(banners, many=True) return resultful.result(data=serialize.data)
def banner_list(request): """ 轮播图序列化 :param request: :return: """ banners = Banner.objects.all() serialize = BannerSerializer(banners, many=True) return restful.result(data=serialize.data)
def banner_list(request): """轮播图列表""" banners = Banner.objects.all() serializer = BannerSerializer(banners, many=True) return restful.result(data=serializer.data)
def banner_list(request): banners = Banner.objects.all() serializers = BannerSerializer(banners, many=True) data = serializers.data return restful.result(data=data)
def banner_list(request): '''传递给art-template banner数据''' banners = Banner.objects.all() serialize = BannerSerializer(banners,many=True) return restful.result(data=serialize.data)
def banner_list(request): banners = Banner.objects.all() serialize = BannerSerializer(banners, many=True) return Response.response(data=serialize.data)