Fixed #9853 -- Added information to the model date/time fields to note the Python objects used to represent them.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@10198 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Gary Wilson Jr 2009-03-30 18:30:44 +00:00
parent 867e71501c
commit 8ed6b2b1d1
1 changed files with 15 additions and 11 deletions

View File

@ -365,13 +365,14 @@ portability mentioned there should be heeded.
.. class:: DateField([auto_now=False, auto_now_add=False, **options]) .. class:: DateField([auto_now=False, auto_now_add=False, **options])
A date field. Has a few extra optional arguments: A date, represented in Python by a ``datetime.date`` instance. Has a few extra,
optional arguments:
.. attribute:: DateField.auto_now .. attribute:: DateField.auto_now
Automatically set the field to now every time the object is saved. Useful Automatically set the field to now every time the object is saved. Useful
for "last-modified" timestamps. Note that the current date is *always* used; for "last-modified" timestamps. Note that the current date is *always*
it's not just a default value that you can override. used; it's not just a default value that you can override.
.. attribute:: DateField.auto_now_add .. attribute:: DateField.auto_now_add
@ -380,18 +381,19 @@ A date field. Has a few extra optional arguments:
it's not just a default value that you can override. it's not just a default value that you can override.
The admin represents this as an ``<input type="text">`` with a JavaScript The admin represents this as an ``<input type="text">`` with a JavaScript
calendar, and a shortcut for "Today". The JavaScript calendar will always start calendar, and a shortcut for "Today". The JavaScript calendar will always
the week on a Sunday. start the week on a Sunday.
``DateTimeField`` ``DateTimeField``
----------------- -----------------
.. class:: DateTimeField([auto_now=False, auto_now_add=False, **options]) .. class:: DateTimeField([auto_now=False, auto_now_add=False, **options])
A date and time field. Takes the same extra options as :class:`DateField`. A date and time, represented in Python by a ``datetime.datetime`` instance.
Takes the same extra arguments as :class:`DateField`.
The admin represents this as two ``<input type="text">`` fields, with JavaScript The admin represents this as two ``<input type="text">`` fields, with
shortcuts. JavaScript shortcuts.
``DecimalField`` ``DecimalField``
---------------- ----------------
@ -706,9 +708,11 @@ input).
.. class:: TimeField([auto_now=False, auto_now_add=False, **options]) .. class:: TimeField([auto_now=False, auto_now_add=False, **options])
A time. Accepts the same auto-population options as :class:`DateField` and A time, represented in Python by a ``datetime.time`` instance. Accepts the same
:class:`DateTimeField`. The admin represents this as an ``<input type="text">`` auto-population options as :class:`DateField`.
with some JavaScript shortcuts.
The admin represents this as an ``<input type="text">`` with some JavaScript
shortcuts.
``URLField`` ``URLField``
------------ ------------