摘要:
CBV源码分析 # ModelViewSet继承View(django原生View) # APIView继承了View # 先读View的源码 from django.views import View # urls.py path('books1/', views.Books.as_view()) 阅读全文
摘要:
推荐一个好用的django方法,用于将model实例转换为dict,命名非常简单粗暴 from django.forms.models import model_to_dictdi = model_to_dict(order, exclude=['create_time', 'update_time 阅读全文