在model中添加字段的格式一般为: field_name = field_type(**field_options) 一 field options(所有字段共用) 1 null 默认为False,True则表示可以为null。(空字符串在数据库中可能被存储为'') 2 blank 默认为Fals ...
分类:
其他好文 时间:
2020-06-12 14:29:41
阅读次数:
52
直接上代码 1 public static string[] GetHtmlImageUrlList(string htmlText) 2 { 3 Regex regImg = new Regex(@"<img\b[^<>]*?\bsrc[\s\t\r\n]*=[\s\t\r\n]*[""']?[\ ...
方法: # django官网提供的一个orm语法 from django.db.models.functions import TruncMonth -官方提供 from django.db.models.functions import TruncMonth Sales.objects .anno ...
分类:
其他好文 时间:
2020-06-12 00:59:52
阅读次数:
60
本篇文章以角色、用户、组三表为例,用户和角色是多对多的关系,用户和组是多对一的关系。关联时使用对方表的id,每张表至少有两个字段:id和name class Group(models.Model): name = models.CharField(max_length=50) class Role( ...
分类:
其他好文 时间:
2020-06-11 00:45:42
阅读次数:
63
xadmin配置 1.在每个apps下新建adminx.py 1.在apps/users下新建adminx.py: import xadmin from xadmin import views from .models import UserProfile,PianQu,LouMing,DanYua ...
分类:
其他好文 时间:
2020-06-09 18:38:16
阅读次数:
56
Regularization Deep Learning models have so much flexibility and capacity that overfitting can be a serious problem,if the training dataset is not big ...
分类:
其他好文 时间:
2020-06-09 18:29:42
阅读次数:
53
def ab_pl(request): # 先给Book插入一万条数据 # for i in range(10000): # models.Book.objects.create(title='第%s本书'%i) # # 再将所有的数据查询并展示到前端页面 book_queryset = model ...
分类:
其他好文 时间:
2020-06-09 00:01:59
阅读次数:
95
数据访问DAL和实体类 UserInfo.cs using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace ...
keras-模型保存和载入 1.数据的载入与预处理 import numpy as np from keras.datasets import mnist from keras.utils import np_utils from keras.models import Sequential,loa ...
分类:
其他好文 时间:
2020-06-08 00:58:22
阅读次数:
88
keras-基于CNN网络的Mnist数据集分类 1.数据的载入和预处理 import numpy as np from keras.datasets import mnist from keras.utils import np_utils from keras.models import Seq ...
分类:
其他好文 时间:
2020-06-08 00:39:40
阅读次数:
70