Django Book 翻译
菜单>:
TOC
返回
原文:
Note that empty string values will always get stored as empty strings, not as ``NULL`` . Only use ``null=True`` for nonstring fields such as integers, Booleans, and dates. For both types of fields, you will also need to set ``blank=True`` if you wish to permit empty values in forms, as the ``null`` parameter only affects database storage (see the following section, titled blank).
翻译:
记住,空字符串值保存时总是以空字符串的形式存在,而不是 ``NULL`` 。一般只对非字符串字段使用 ``null=True`` ,比如整型、布尔型和日期型。对于这两种字段,如果你允许表单中的对应值为空的话,你还需要设定 ``blank=True`` ,因为 ``null`` 参数只影响数据库存储(参见下面题为blank的一节)。
备注:
译者: