示例#1
0
文件: views.py 项目: cjmonkey/django
def banner_list(request):

    # 序列化数据
    banners = Banner.objects.all()
    serialize = BannerSerializer(banners, many=True)

    return restful.result(data=serialize.data)
示例#2
0
def banner_list(request):
    """
    展示所有轮播图
    """
    banners = Banner.objects.all()
    # 序列化,即将外键等同时也查询出来。序列化为一个json数据
    serialize = BannerSerializer(banners, many=True)
    return resultful.result(data=serialize.data)
示例#3
0
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)
示例#5
0
def banner_list(request):
    banners = Banner.objects.all()
    serializers = BannerSerializer(banners, many=True)
    data = serializers.data
    return restful.result(data=data)
示例#6
0
文件: views.py 项目: P79N6A/xfz
def banner_list(request):
    '''传递给art-template banner数据'''
    banners = Banner.objects.all()
    serialize = BannerSerializer(banners,many=True)
    return restful.result(data=serialize.data)
示例#7
0
文件: views.py 项目: xiaoxiaolulu/xfz
def banner_list(request):
    banners = Banner.objects.all()
    serialize = BannerSerializer(banners, many=True)
    return Response.response(data=serialize.data)