Django Book 翻译
菜单>:
TOC
返回
原文:
.. table:: Table B-1. Extra DateField Options +----------------+-----------------------------------------------------------------------------------------+ |Argument |Description | +================+=========================================================================================+ |``auto_now`` |Automatically sets the field to now every time the object is saved. Its useful for | | |last-modified timestamps. Note that the current date is *always* used; its not just a | | |default value that you can override. | +----------------+-----------------------------------------------------------------------------------------+ |``auto_now_add``|Automatically sets the field to now when the object is first created. Its useful for | | |creation of timestamps. Note that the current date is *always* used; its not just a | | |default value that you can override. | +----------------+-----------------------------------------------------------------------------------------+
翻译:
.. table:: 表B-1. 额外的 DateField 选项 +----------------+-----------------------------------------------------------------------------------------+ |Argument |Description | +================+=========================================================================================+ |``auto_now`` |每次对象保存时,自动设置为当前日期。一般用来产生最后一次修改时间。 | | | | | |注意:使用此选项的字段的值总是在保存时被设置为保存时的日期,这是无法改变的。 | +----------------+-----------------------------------------------------------------------------------------+ |``auto_now_add``|当对象第一次产生时字段设置为当前日期。一般用来产生对象的建立时间。 | | | | | |注意:使用此选项的字段值总是在对象建立时被设置为建立时的日期,这是无法改变的。 | +----------------+-----------------------------------------------------------------------------------------+
备注:
译者: