Django.1.sqlite3 & magrations clearing.2017-08-08

python manage.py makemigrations
... migrate
... createsupersuer[name:password]

sqlite3:

/tongheng$ sqlite3

... .databases
... .open tongheng.db
... .tables
... select count() from tablename
... drop table tablename
... PRAGMA table_info(tablename)
  ...> ;
0|creatdate|TEXT|0||0
1|creathour|INTEGER|0||0
2|mean|REAL|0||0
3|max|REAL|0||0
4|min|REAL|0||0
5|abnormal_mean|REAL|0||0
6|abnormal_times|INTEGER|0||0

magrations下文件太多,使用如下步骤清理

http://blog.csdn.net/zhuoxiuwu/article/details/52167599

python manage.py makemigrations
python manage.py showmigrations
python manage.py migrate --fake appname zero
python manage.py showmigrations # [X] 变为[  ]
# 删除app/migrations/下除__init__.py的文件
python manage.py makemigrations
python manage.py migrate --fake-initial
python manage.py migrate
Django.1.sqlite3 & magrations clearing.2017-08-08_第1张图片
python manage.py showmigrations

数据库操作

modelName.objects.filter(id__in = [65190, 65193,1])
__range = [a, b] # bound
__gt # >
__gte # >=
__lt # <
__lte # <=

modelName.objects.order_by("state_province", "address") # 第一个相同,按第二个排序

js:

async:false,

你可能感兴趣的:(Django.1.sqlite3 & magrations clearing.2017-08-08)