Django Book 翻译
菜单>:
TOC
返回
原文:
Finally, note that ``__str__()`` is a good example of adding *behavior* to models. A Django model describes more than the database table layout for an object; it also describes any functionality that object knows how to do. ``__str__()`` is one example of such functionality a model knows how to display itself.
翻译:
最后, ``__str()__`` 也是一个很好的例子来演示我们怎么添加 *行为* 到模型里。 Django的模型不只是为对象定义了数据库表的结构,还定义了对象的行为。 ``__str__()`` 就是一个例子来演示模型知道怎么显示它们自己。
备注:
译者: