web2py auto_import vs define_table

时光毁灭记忆、已成空白 提交于 2019-12-09 08:15:28

With auto_import=True, web2py will get the field names and types directly from the *.table files in the application's "databases" folder. When the documentation refers to "web2py table attributes" that will not be available, it is referring to attributes that are defined in the model (i.e., using db.define_table()) but not stored in the database or *.table files, such as "requires", "widget", "represent", etc. Those attributes are defined only in web2py code and therefore cannot be determined merely by reading the *.table files. Note, the *.table files are used for database migrations, so they only store metadata directly relevant to the database (i.e., field names and types, and database-level contraints, such as "notnull" and "unique"). Attributes like "requires" and "represent" are only used by web2py and have no effect on the database, so are not recorded in the *.table files.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!