Python全系列 教程
3567个小节阅读:5929.8k
目录
鸿蒙应用开发
C语言快速入门
JAVA全系列 教程
面向对象的程序设计语言
Python全系列 教程
Python3.x版本,未来主流的版本
人工智能 教程
顺势而为,AI创新未来
大厂算法 教程
算法,程序员自我提升必经之路
C++ 教程
一门通用计算机编程语言
微服务 教程
目前业界流行的框架组合
web前端全系列 教程
通向WEB技术世界的钥匙
大数据全系列 教程
站在云端操控万千数据
AIGC全能工具班
A A
White Night
xxxxxxxxxx
61insert into t_feature_service (name) VALUES ('随时有问必答,攻克技术难点');
2insert into t_feature_service (name) VALUES ('定制职业发展路线');
3insert into t_feature_service (name) VALUES ('督导老师、辅导老师、职业规划师服务');
4insert into t_feature_service (name) VALUES ('学习效果测评,作业点评');
5insert into t_feature_service (name) VALUES ('注重项目实战讲解');
6insert into t_feature_service (name) VALUES ('重点、答疑、学习指导行业大牛分享');
修改homepage_app\serialiazers.py
模块,添加获取服务特色列表序列化器
xxxxxxxxxx
81from rest_framework import serializers
2
3from .models import FeatureService
4
5class FeatureServiceListSerializer(serializers.ModelSerializer):
6 class Meta:
7 model = FeatureService
8 fields = '__all__'
修改homepage_app\views.py
模块,添加获取服务特色列表视图
xxxxxxxxxx
91from rest_framework import generics
2
3from .models import FeatureService
4from .serializers import FeatureServiceListSerializer
5
6# 建立服务特色列表视图
7class FeatureServiceListAPIView(generics.ListAPIView):
8 queryset = FeatureService.objects.all().order_by('-id')
9 serializer_class = FeatureServiceListSerializer
修改homepage_app\urls.py
模块,添加获取服务特色列表接口路由
xxxxxxxxxx
81from django.urls import path
2
3from . import views
4
5urlpatterns = [
6 path('rotation_chart/', views.RotationChartListAPIView.as_view()),
7 path('feature_service/', views.FeatureServiceListAPIView.as_view()),
8]