摘要:
views.py: # 自定义规则 class TestValidator(object): def __init__(self, base): self.base = base def __call__(self, value): # 规则明细 if not value.startswith(se 阅读全文
摘要:
views.py: from rest_framework.views import APIView from rest_framework import serializers from django.shortcuts import HttpResponse class UserGroupSer 阅读全文
摘要:
数据库结构和此文章相同:https://www.cnblogs.com/sch01ar/p/14295875.html urls.py: from django.urls import path, re_path from drf import views urlpatterns = [ path( 阅读全文
摘要:
数据库结构和上篇文章一样:https://www.cnblogs.com/sch01ar/p/14295875.html views.py: from rest_framework.views import APIView from rest_framework import serializers 阅读全文