美文网首页
Django.1.sqlite3 & magrations cl

Django.1.sqlite3 & magrations cl

作者: 小异_Summer | 来源:发表于2017-08-08 15:27 被阅读0次
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
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 cl

    sqlite3: magrations下文件太多,使用如下步骤清理 http://blog.csdn.net/zh...

  • 关于django migration简单原理介绍

    在执行 python manage.py magrations 时 django 会在相应的 app 的migra...

  • shell脚本for循环

    1、循环表达式1 输出cl_acl2014cl_res2014cl_laptop2014cl_res2015cl_...

  • 准星通知

    ① ②标题② ③内容③ 【标题】 内容 『cl1』b『cl1』 【标题】 内容 『cl2』c『cl2』 【标题】 ...

  • 2020-01-09

    SA537CL1_SA537CL2淬火回火_SA537CL3碳锰硅钢板SA537CL1价格_SA537CL2切割_...

  • CL

    有人说,这是一部温暖的动漫。让人回味无穷。看这部动漫会为之感动,为其涕泪,会想让身边的人也参与其中,一起被温暖,一...

  • CL

    或许是心里有人吧,无论怎样都看不到别人的好。

  • CL

    和他真正成为朋友是因为我们是前后桌,那真是个偶然的机会,本来打算是坐另一个位置的,机缘巧合的坐在了他前面,或许这就...

  • cl

    cl

  • hello world

    名词的概念: 1、cl_int clGetPlatformIDs (cl_uint num_entries,cl_...

网友评论

      本文标题:Django.1.sqlite3 & magrations cl

      本文链接:https://www.haomeiwen.com/subject/hfbtrxtx.html