summaryrefslogtreecommitdiff
path: root/docs/ref/forms/fields.txt
diff options
context:
space:
mode:
authorKaren Tracey <kmtracey@gmail.com>2009-03-22 16:13:06 +0000
committerKaren Tracey <kmtracey@gmail.com>2009-03-22 16:13:06 +0000
commit14b160957e2965669e241f4640dd42a0fc412ec4 (patch)
tree9069f7bb839ca154f851515ad3e08b86841c03b3 /docs/ref/forms/fields.txt
parentb203db6ec850fee9ad8f2e2c8873be986325572b (diff)
Fixed #8962 -- Consistently support format and input_format in the various (individual, combined, split) date and time form fields and widgets.
Many thanks to Tai Lee for doing all the work here. git-svn-id: http://code.djangoproject.com/svn/django/trunk@10115 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'docs/ref/forms/fields.txt')
-rw-r--r--docs/ref/forms/fields.txt36
1 files changed, 35 insertions, 1 deletions
diff --git a/docs/ref/forms/fields.txt b/docs/ref/forms/fields.txt
index 2f40b6f539..4248af3d26 100644
--- a/docs/ref/forms/fields.txt
+++ b/docs/ref/forms/fields.txt
@@ -398,7 +398,7 @@ Takes extra arguments:
.. class:: DateField(**kwargs)
- * Default widget: ``TextInput``
+ * Default widget: ``DateInput``
* Empty value: ``None``
* Normalizes to: A Python ``datetime.date`` object.
* Validates that the given value is either a ``datetime.date``,
@@ -420,6 +420,10 @@ If no ``input_formats`` argument is provided, the default input formats are::
'%B %d %Y', '%B %d, %Y', # 'October 25 2006', 'October 25, 2006'
'%d %B %Y', '%d %B, %Y', # '25 October 2006', '25 October, 2006'
+.. versionchanged:: 1.1
+ The ``DateField`` previously used a ``TextInput`` widget by default. It now
+ uses a ``DateInput`` widget.
+
``DateTimeField``
~~~~~~~~~~~~~~~~~
@@ -739,6 +743,36 @@ The following are not yet documented.
.. class:: SplitDateTimeField(**kwargs)
+ * Default widget: ``SplitDateTimeWidget``
+ * Empty value: ``None``
+ * Normalizes to: A Python ``datetime.datetime`` object.
+ * Validates that the given value is a ``datetime.datetime`` or string
+ formatted in a particular datetime format.
+ * Error message keys: ``required``, ``invalid``
+
+Takes two optional arguments:
+
+.. attribute:: SplitDateTimeField.input_date_formats
+
+ A list of formats used to attempt to convert a string to a valid
+ ``datetime.date`` object.
+
+If no ``input_date_formats`` argument is provided, the default input formats
+for ``DateField`` are used.
+
+.. attribute:: SplitDateTimeField.input_time_formats
+
+ A list of formats used to attempt to convert a string to a valid
+ ``datetime.time`` object.
+
+If no ``input_time_formats`` argument is provided, the default input formats
+for ``TimeField`` are used.
+
+.. versionchanged:: 1.1
+ The ``SplitDateTimeField`` previously used two ``TextInput`` widgets by
+ default. The ``input_date_formats`` and ``input_time_formats`` arguments
+ are also new.
+
Fields which handle relationships
---------------------------------