问题1.将主键id改成自动生成的python3 manage.py migrate时报下面的错误 django.db.utils.InternalError: (1091, "Can't DROP 'id'; check that column/key exists") 我猜测是因为我改了两个表的主 ...
分类:
其他好文 时间:
2017-02-18 09:52:38
阅读次数:
1502
第一步:安装PyMySQ代替MySQLdb pip3 install PyMySQL 然后在工程目录的__init__.py中填写下面两句话 import pymysql pymysql.install_as_MySQLdb() import pymysql pymysql.install_as_M ...
分类:
数据库 时间:
2017-02-18 09:49:11
阅读次数:
376
--操作日志表 CREATE TABLE [dbo].[JobLog]( [JobLogId] [int] IDENTITY(1,1) NOT NULL, [FunctionId] [nvarchar](20) NULL, [OperateTime] [datetime] NULL, CONSTRA ...
分类:
编程语言 时间:
2017-02-18 01:06:51
阅读次数:
292
public ActionResult GetDateTime(string userName,int age) { System.Threading.Thread.Sleep(2000); return Content(DateTime.Now.ToString() + userName + ag... ...
分类:
Web程序 时间:
2017-02-17 23:43:19
阅读次数:
313
BaseException
+--SystemExit
+--KeyboardInterrupt
+--GeneratorExit
+--Exception
+--StopIteration
+--StopAsyncIteration
+--ArithmeticError
|+--FloatingPointError
|+--OverflowError
|+--ZeroDivisionError
+--AssertionError
+--AttributeError
+--BufferError
+--EOF..
分类:
编程语言 时间:
2017-02-17 22:14:50
阅读次数:
221
public List<policecase> GetPoliceCaseList(PoliceCaseFilter view) { string sqlString = "SELECT value pc FROM Entities.policecase AS pc"; var where = "" ...
分类:
数据库 时间:
2017-02-17 21:38:28
阅读次数:
243
python2 存在内存里的 字符串就是bytes,bytes就是字符串, 需要先解码(decode),再编码(encode) python3 字符串 = unicode, bytes = py2 bytes, 不需要解码,自动转成unicode编码(没有decode方法) 如果需要转成别的格式,可 ...
分类:
其他好文 时间:
2017-02-17 13:00:25
阅读次数:
260
很多人在学习python3的时候,在字典部分copy和deepcopy感到很困惑,现在针对这两个方法进行区分,即一种是浅复制(copy),一种是深度复制(deepcopy)。开头先下个结论我们日常所说的复制(自己在电脑硬盘上的复制)就是深复制(deepcopy),即将被复制对象完全再复制一遍作为..
分类:
编程语言 时间:
2017-02-17 00:56:30
阅读次数:
291
-- 定义触发器 CREATE TRIGGER "vss_after_insert_flow_201702" AFTER INSERT ON "public"."vss_passenger_flow_201702" FOR EACH ROW EXECUTE PROCEDURE "vss_after_... ...
分类:
数据库 时间:
2017-02-16 23:15:10
阅读次数:
1957
python版本py3 tail -f file是打印最后10行,然后跟踪文件追加的内容打印出来。 python3 以为本方式打开的话,不能回退(f.seek(-1,1)),所有以'rb'方式打开文件。 思路是f.seek(-n,2)从文件末尾回退n字节,然后f.readlines()读取文件,如果 ...
分类:
其他好文 时间:
2017-02-16 22:49:22
阅读次数:
362