如果要在django的模型中添加方法,推荐在模型的自定义管理其中添加方法。 不能使用__init__方法,因为模型继承的父类也有__init__方法。 模型models.py中 关键代码: class BookInfoManager(models.Manager): # 自定义管理器:应用二 扩展方 ...
分类:
其他好文 时间:
2020-05-09 01:00:01
阅读次数:
172
MVC 架构 MVC 前端: View 层 后端: Control 层 && Model 层 Serverless 解决问题的边界,就是服务端的边界,即服务端运维。 Serverless 狭义 Serverless(最常见)= Serverless computing 架构 = FaaS 架构 = ...
分类:
其他好文 时间:
2020-05-09 00:51:18
阅读次数:
105
(venv) D:\mukewang\django_air>python manage.py makemigrations Migrations for 'blog': blog\migrations\0001_initial.py - Create model Article (venv) D:\ ...
分类:
其他好文 时间:
2020-05-09 00:25:25
阅读次数:
99
v-model的修饰符v-model.lazy 只有在input输入框发生一个blur时才触发v-model.trim 将用户输入的前后的空格去掉v-model.number 将用户输入的字符串转换成number在input textarea select中使用 在事件处理程序中调用 event.p ...
分类:
其他好文 时间:
2020-05-08 13:17:02
阅读次数:
181
namespace app\index\controller; use think\Controller; use app\index\model\User; class Index extends Controller { public function index() { $User = new ...
分类:
其他好文 时间:
2020-05-08 10:06:44
阅读次数:
92
It can be understood as: the value of an addition revenue if the constraint is relaxed. or How much you would be willing to pay for an additional reso ...
分类:
其他好文 时间:
2020-05-08 00:28:57
阅读次数:
110
读者指南 目的:为了更好地理解Maven插件 参考文档:菜鸟教程 https://www.runoob.com/maven/maven-tutorial.html Maven是什么? apache项目,纯java开发,基于POM(Project object model),管理项目的构建、报告、文档 ...
分类:
其他好文 时间:
2020-05-07 21:23:15
阅读次数:
79
DRF 版本 认证 DRF的版本 版本控制是做什么用的, 我们为什么要用 首先我们要知道我们的版本是干嘛用的呢~~大家都知道我们开发项目是有多个版本的~~ 当我们项目越来越更新~版本就越来越多~~我们不可能新的版本出了~以前旧的版本就不进行维护了~~~ 那我们就需要对版本进行控制~~这个DRF也给我 ...
分类:
其他好文 时间:
2020-05-07 18:10:43
阅读次数:
64
FBV & CBV FBV 基于函数的view视图写法 function based view CBV 基于类的view视图写法 class based view View类dispatch扩展 ...
分类:
其他好文 时间:
2020-05-07 15:20:00
阅读次数:
56
官方案例如下: <div id='example-3'> <input type="checkbox" id="jack" value="Jack" v-model="checkedNames"> <label for="jack">Jack</label> <input type="checkbo ...
分类:
其他好文 时间:
2020-05-07 13:48:52
阅读次数:
62