Django Book 翻译
菜单>:
TOC
返回
原文:
Lets quickly examine this code to cover the basics. The first thing to notice is that each model is represented by a Python class that is a subclass of ``django.db.models.Model`` . The parent class, ``Model`` , contains all the machinery necessary to make these objects capable of interacting with a database and that leaves our models responsible solely for defining their fields, in a nice and compact syntax. Believe it or not, this is all the code we need to write to have basic data access with Django.
翻译:
让我们来快速讲解一下这些代码的含义。首先要注意的事是每个数据模型都是 ``django.db.models.Model`` 的子类。它的父类 ``Model`` 包含了所有和数据库 打交道的方法,并提供了一个简洁漂亮的定义语法。不管你相信还是不相信, 这就是我们用Django写的数据基本存取功能的全部代码。
备注:
译者: