Django Book 翻译
菜单>:
TOC
返回
原文:
As we discussed earlier in this chapter, the M in MTV stands for Model. A Django model is a description of the data in your database, represented as Python code. Its your data layout the equivalent of your SQL ``CREATE TABLE`` statements except its in Python instead of SQL, and it includes more than just database column definitions. Django uses a model to execute SQL code behind the scenes and return convenient Python data structures representing the rows in your database tables. Django also uses models to represent higher-level concepts that SQL cant necessarily handle.
翻译:
我们早些时候谈到。MTV里的M代表模型。Django模型是用Python代码形式表述的数据在数据库中的定义。对数据层来说它等同于 ``CREATE TABLE`` 语句,只不过执行的是Python代码而不是SQL,而且还包含了比数据库字段定义更多的含义。Django用模型在后台执行SQL代码并把结果用Python的数据结构来描述,这样你可以很方便的使用这些数据。Django还用模型来描述SQL不能处理的高级概念。
备注:
译者: