Django Book 翻译
菜单>:
TOC
返回
原文:
Djangos database layer generates SQL schemas from Python code but with a legacy database, you already have the SQL schemas. In such a case, youll need to create models for your existing database tables. For this purpose, Django comes with a tool that can generate model code by reading your database table layouts. This tool is called ``inspectdb`` , and you can call it by executing the command ``manage.py inspectdb`` .
翻译:
Django的数据库层从Python代码生成SQL schemas--但是对于遗留数据库,你已经拥有SQL schemas,这种情况下你需要为你 已经存在的数据库表写模型(由于性能的原因,Django的数据库层不支持通过运行时自省数据库的不工作的对象-关系映射, 为了使用数据库API,你需要写模型代码),幸运的是,Django带有通过阅读你的数据库表规划来生成模型代码的辅助工具 该辅助工具称为manage.py inspectdb
备注:
译者: