V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
推荐学习书目
Learn Python the Hard Way
Python Sites
PyPI - Python Package Index
http://diveintopython.org/toc/index.html
Pocoo
值得关注的项目
PyPy
Celery
Jinja2
Read the Docs
gevent
pyenv
virtualenv
Stackless Python
Beautiful Soup
结巴中文分词
Green Unicorn
Sentry
Shovel
Pyflakes
pytest
Python 编程
pep8 Checker
Styles
PEP 8
Google Python Style Guide
Code Style from The Hitchhiker's Guide
shimingzhoudf
V2EX  ›  Python

django 库名

  •  
  •   shimingzhoudf · 2019-10-15 11:13:04 +08:00 · 2153 次点击
    这是一个创建于 1648 天前的主题,其中的信息可能已经有所发展或是发生改变。

    django 的数据库表名怎么设置默认为大写,,自动的生成的表,比如(auth_group,auth_group_permissions,auth_permission 等等)

    1 条回复    2019-10-15 22:59:15 +08:00
    xpresslink
        1
    xpresslink  
       2019-10-15 22:59:15 +08:00
    自定义的 model 可以指定表名。
    https://docs.djangoproject.com/en/2.2/topics/db/models/#meta-options
    https://docs.djangoproject.com/en/2.2/ref/models/options/

    你说的那个几个自动生成的表是 内置 auth 应用模块中定义的类生成的,要魔改那部分的 Model 定义源代码才能实现, 以你的水平应该还没能力改。
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   3064 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 35ms · UTC 11:01 · PVG 19:01 · LAX 04:01 · JFK 07:01
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.