牛二的梦想  

2019年2月16日

摘要: 如何高效查询表的总记录数(通用方法) 很多表都会设计一个步长为1的自增长整型(INT)列作为表主键,该做法优劣这里不展开讨论,仅基于这一"习惯",外加一个假设:该字段连续无为断,则可以使用MAX函数了,限制较多哈 1,自增长列 2,该列连续 阅读全文
posted @ 2019-02-16 14:23 牛二的梦想 阅读(761) 评论(0) 推荐(0) 编辑

2019年2月12日

摘要: {# 如果 a1 == a2 则显示 #} {% ifequal a1 a2 %} <h1>equal!</h1> {% else %} <h1>not equal!</h1> {% endifequal %} 附:Paginator类的解释,方法,属性 class Paginator(object 阅读全文
posted @ 2019-02-12 17:56 牛二的梦想 阅读(207) 评论(0) 推荐(0) 编辑
 
摘要: 在VBA中做了一个比较体积,如果体积相似就显示隔壁单元格的内容 Function VC(a, b As Range) 'VolumeCompare体积比较 Dim arry() As Variant Dim i, c, d As Integer Dim kmin As Double Dim kmin 阅读全文
posted @ 2019-02-12 15:16 牛二的梦想 阅读(205) 评论(0) 推荐(0) 编辑

2019年2月11日

摘要: A well known speaker started off his seminar by holding up a $20 bill.In the room of 200, he asked. "Who would like this $20 bill?"Hands started going 阅读全文
posted @ 2019-02-11 17:17 牛二的梦想 阅读(159) 评论(0) 推荐(0) 编辑
 
摘要: 今天在学习例子的时候 不注意吧settings.py里面的INSTALL APPS 的APP应用名称写错了 应该是blog 写成了myblog 结果导致python manage.py makemigrations; python manage.py migrate没有反应。 在这个小坑上折腾了半个 阅读全文
posted @ 2019-02-11 16:42 牛二的梦想 阅读(382) 评论(0) 推荐(0) 编辑

2019年2月8日

摘要: settings.py#设置文件上传路径,图片上传、文件上传都会存放在此目录里MEDIA_URL = '/media/'MEDIA_ROOT = os.path.join(BASE_DIR, 'media') #PEP8:missing whitespace around operator os前后 阅读全文
posted @ 2019-02-08 10:06 牛二的梦想 阅读(1476) 评论(0) 推荐(0) 编辑

2019年2月5日

摘要: class ModelAdmin(BaseModelAdmin): """Encapsulate all admin options and functionality for a given model.""" list_display = ('__str__',)# 列表里显示想要显示的字段 l 阅读全文
posted @ 2019-02-05 20:37 牛二的梦想 阅读(131) 评论(0) 推荐(0) 编辑