Ejemplo n.º 1
0
def banner_list(request):

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

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