summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorHonza Král <honza.kral@gmail.com>2010-01-04 01:06:26 +0000
committerHonza Král <honza.kral@gmail.com>2010-01-04 01:06:26 +0000
commitffd5564a87c5c8e5d5e1e201ae3462807b955efc (patch)
tree80c63887e1e9a9a2d379e655ad038f25f3982697 /docs
parenta7c320fea79b8750ab2a8aca84d8e8fb76d8b100 (diff)
[soc2009/model-validation] Merged to trunk at r12070
git-svn-id: http://code.djangoproject.com/svn/django/branches/soc2009/model-validation@12073 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'docs')
-rw-r--r--docs/ref/contrib/localflavor.txt103
-rw-r--r--docs/ref/django-admin.txt6
-rw-r--r--docs/ref/settings.txt2
-rw-r--r--docs/ref/templates/builtins.txt2
-rw-r--r--docs/releases/1.1.2.txt15
-rw-r--r--docs/releases/1.2.txt20
-rw-r--r--docs/topics/auth.txt2
-rw-r--r--docs/topics/testing.txt21
8 files changed, 150 insertions, 21 deletions
diff --git a/docs/ref/contrib/localflavor.txt b/docs/ref/contrib/localflavor.txt
index 660b7c623b..1c58e2d5e8 100644
--- a/docs/ref/contrib/localflavor.txt
+++ b/docs/ref/contrib/localflavor.txt
@@ -50,13 +50,17 @@ Countries currently supported by :mod:`~django.contrib.localflavor` are:
* Germany_
* Iceland_
* India_
+ * Indonesia_
+ * Ireland_
* Italy_
* Japan_
+ * Kuwait_
* Mexico_
* `The Netherlands`_
* Norway_
* Peru_
* Poland_
+ * Portugal_
* Romania_
* Slovakia_
* `South Africa`_
@@ -65,6 +69,7 @@ Countries currently supported by :mod:`~django.contrib.localflavor` are:
* Switzerland_
* `United Kingdom`_
* `United States of America`_
+ * Uruguay_
The ``django.contrib.localflavor`` package also includes a ``generic`` subpackage,
containing useful code that is not specific to one particular country or culture.
@@ -92,12 +97,16 @@ Here's an example of how to use them::
.. _The Netherlands: `The Netherlands (nl)`_
.. _Iceland: `Iceland (is\_)`_
.. _India: `India (in\_)`_
+.. _Indonesia: `Indonesia (id)`_
+.. _Ireland: `Ireland (ie)`_
.. _Italy: `Italy (it)`_
.. _Japan: `Japan (jp)`_
+.. _Kuwait: `Kuwait (kw)`_
.. _Mexico: `Mexico (mx)`_
.. _Norway: `Norway (no)`_
.. _Peru: `Peru (pe)`_
.. _Poland: `Poland (pl)`_
+.. _Portugal: `Portugal (pt)`_
.. _Romania: `Romania (ro)`_
.. _Slovakia: `Slovakia (sk)`_
.. _South Africa: `South Africa (za)`_
@@ -106,6 +115,7 @@ Here's an example of how to use them::
.. _Switzerland: `Switzerland (ch)`_
.. _United Kingdom: `United Kingdom (uk)`_
.. _United States of America: `United States of America (us)`_
+.. _Uruguay: `Uruguay (uy)`_
Adding flavors
==============
@@ -369,6 +379,46 @@ India (``in_``)
A ``Select`` widget that uses a list of Indian states/territories as its
choices.
+Ireland (``ie``)
+================
+
+.. class:: ie.forms.IECountySelect
+
+ A ``Select`` widget that uses a list of Irish Counties as its choices.
+
+Indonesia (``id``)
+==================
+
+.. class:: id.forms.IDPostCodeField
+
+ A form field that validates input as an Indonesian post code field.
+
+.. class:: id.forms.IDProvinceSelect
+
+ A ``Select`` widget that uses a list of Indonesian provinces as its choices.
+
+.. class:: id.forms.IDPhoneNumberField
+
+ A form field that validates input as an Indonesian telephone number.
+
+.. class:: id.forms.IDLicensePlatePrefixSelect
+
+ A ``Select`` widget that uses a list of Indonesian license plate
+ prefix code as its choices.
+
+.. class:: id.forms.IDLicensePlateField
+
+ A form field that validates input as an Indonesian vehicle license plate.
+
+.. class:: id.forms.IDNationalIdentityNumberField
+
+ A form field that validates input as an Indonesian national identity
+ number (`NIK`_/KTP). The output will be in the format of
+ 'XX.XXXX.DDMMYY.XXXX'. Dots or spaces can be used in the input to break
+ down the numbers.
+
+.. _NIK: http://en.wikipedia.org/wiki/Indonesian_identity_card
+
Italy (``it``)
==============
@@ -408,6 +458,18 @@ Japan (``jp``)
A ``Select`` widget that uses a list of Japanese prefectures as its choices.
+Kuwait (``kw``)
+===============
+
+.. class:: kw.forms.KWCivilIDNumberField
+
+ A form field that validates input as a Kuwaiti Civil ID number. A valid
+ Civil ID number must obey the following rules:
+
+ * The number consist of 12 digits.
+ * The birthdate of the person is a valid date.
+ * The calculated checksum equals to the last digit of the Civil ID.
+
Mexico (``mx``)
===============
@@ -438,31 +500,31 @@ Norway (``no``)
Peru (``pe``)
=============
-.. class:: pt.forms.PEDNIField
+.. class:: pe.forms.PEDNIField
A form field that validates input as a DNI (Peruvian national identity)
number.
-.. class:: pt.forms.PERUCField
+.. class:: pe.forms.PERUCField
A form field that validates input as an RUC (Registro Unico de
Contribuyentes) number. Valid RUC numbers have 11 digits.
-.. class:: pt.forms.PEDepartmentSelect
+.. class:: pe.forms.PEDepartmentSelect
A ``Select`` widget that uses a list of Peruvian Departments as its choices.
Poland (``pl``)
===============
-.. class:: pl.forms.PLNationalIdentificationNumberField
+.. class:: pl.forms.PLPESELField
A form field that validates input as a Polish national identification number
(PESEL_).
.. _PESEL: http://en.wikipedia.org/wiki/PESEL
-.. class:: pl.forms.PLNationalBusinessRegisterField
+.. class:: pl.forms.PLREGONField
A form field that validates input as a Polish National Official Business
Register Number (REGON_), having either seven or nine digits. The checksum
@@ -476,22 +538,35 @@ Poland (``pl``)
A form field that validates input as a Polish postal code. The valid format
is XX-XXX, where X is a digit.
-.. class:: pl.forms.PLTaxNumberField
+.. class:: pl.forms.PLNIPField
A form field that validates input as a Polish Tax Number (NIP). Valid
formats are XXX-XXX-XX-XX or XX-XX-XXX-XXX. The checksum algorithm used
for NIPs is documented at http://wipos.p.lodz.pl/zylla/ut/nip-rego.html.
-.. class:: pl.forms.PLAdministrativeUnitSelect
+.. class:: pl.forms.PLCountySelect
A ``Select`` widget that uses a list of Polish administrative units as its
choices.
-.. class:: pl.forms.PLVoivodeshipSelect
+.. class:: pl.forms.PLProvinceSelect
A ``Select`` widget that uses a list of Polish voivodeships (administrative
provinces) as its choices.
+Portugal (``pt``)
+=================
+
+.. class:: pt.forms.PTZipCodeField
+
+ A form field that validates input as a Portuguese zip code.
+
+.. class:: pt.forms.PTPhoneNumberField
+
+ A form field that validates input as a Portuguese phone number.
+ Valid numbers have 9 digits (may include spaces) or start by 00
+ or + (international).
+
Romania (``ro``)
================
@@ -738,3 +813,15 @@ United States of America (``us``)
A model field that forms represent as a ``forms.USStateField`` field and
stores the two-letter U.S. state abbreviation in the database.
+
+Uruguay (``uy``)
+================
+
+.. class:: uy.forms.UYCIField
+
+ A field that validates Uruguayan 'Cedula de identidad' (CI) numbers.
+
+.. class:: uy.forms.UYDepartamentSelect
+
+ A ``Select`` widget that uses a list of Uruguayan departaments as its
+ choices.
diff --git a/docs/ref/django-admin.txt b/docs/ref/django-admin.txt
index 2cd879423c..88715ebdc7 100644
--- a/docs/ref/django-admin.txt
+++ b/docs/ref/django-admin.txt
@@ -812,12 +812,10 @@ test <app or test identifier>
Runs tests for all installed models. See :ref:`topics-testing` for more
information.
---failfast
-~~~~~~~~~~
-
.. versionadded:: 1.2
+.. django-admin-option:: --failfast
-Use the ``--failfast`` option to stop running tests and report the failure
+Use the :djadminopt:`--failfast` option to stop running tests and report the failure
immediately after a test fails.
testserver <fixture fixture ...>
diff --git a/docs/ref/settings.txt b/docs/ref/settings.txt
index 8cbc9ccc8f..daedc87d21 100644
--- a/docs/ref/settings.txt
+++ b/docs/ref/settings.txt
@@ -219,7 +219,7 @@ SQLite. This can be configured using the following::
DATABASES = {
'default': {
- 'BACKEND': 'django.db.backends.sqlite3',
+ 'ENGINE': 'django.db.backends.sqlite3',
'NAME': 'mydatabase'
}
}
diff --git a/docs/ref/templates/builtins.txt b/docs/ref/templates/builtins.txt
index b7afa15f7f..51ef03c886 100644
--- a/docs/ref/templates/builtins.txt
+++ b/docs/ref/templates/builtins.txt
@@ -637,6 +637,7 @@ Available format strings:
A ``'AM'`` or ``'PM'``. ``'AM'``
b Month, textual, 3 letters, lowercase. ``'jan'``
B Not implemented.
+ c ISO 8601 Format. ``2008-01-02 10:30:00.000123``
d Day of the month, 2 digits with ``'01'`` to ``'31'``
leading zeros.
D Day of the week, textual, 3 letters. ``'Fri'``
@@ -673,6 +674,7 @@ Available format strings:
month, 2 characters.
t Number of days in the given month. ``28`` to ``31``
T Time zone of this machine. ``'EST'``, ``'MDT'``
+ u Microseconds. ``0`` to ``999999``
U Seconds since the Unix Epoch
(January 1 1970 00:00:00 UTC).
w Day of the week, digits without ``'0'`` (Sunday) to ``'6'`` (Saturday)
diff --git a/docs/releases/1.1.2.txt b/docs/releases/1.1.2.txt
index 64bbdd5dde..4c887ad4a5 100644
--- a/docs/releases/1.1.2.txt
+++ b/docs/releases/1.1.2.txt
@@ -19,8 +19,21 @@ development or deployment currently using or targeting Django 1.1.
For full details on the new features, backwards incompatibilities, and
deprecated features in the 1.1 branch, see the :ref:`releases-1.1`.
+Backwards-incompatible changes in 1.1.2
+=======================================
+
+Test runner exit status code
+----------------------------
+
+The exit status code of the test runners (``tests/runtests.py`` and ``python
+manage.py test``) no longer represents the number of failed tests, since a
+failure of 256 or more tests resulted in a wrong exit status code. The exit
+status code for the test runner is now 0 for success (no failing tests) and 1
+for any number of test failures. If needed, the number of test failures can be
+found at the end of the test runner's output.
+
One new feature
----------------
+===============
Ordinarily, a point release would not include new features, but in the
case of Django 1.1.2, we have made an exception to this rule. Django
diff --git a/docs/releases/1.2.txt b/docs/releases/1.2.txt
index 8810963eaa..a549bd0cce 100644
--- a/docs/releases/1.2.txt
+++ b/docs/releases/1.2.txt
@@ -232,6 +232,16 @@ party packages, or that you wrote yourself, you should ensure that the
information, see
:ref:`template tag thread safety considerations<template_tag_thread_safety>`.
+Test runner exit status code
+----------------------------
+
+The exit status code of the test runners (``tests/runtests.py`` and ``python
+manage.py test``) no longer represents the number of failed tests, since a
+failure of 256 or more tests resulted in a wrong exit status code. The exit
+status code for the test runner is now 0 for success (no failing tests) and 1
+for any number of test failures. If needed, the number of test failures can be
+found at the end of the test runner's output.
+
.. _deprecated-features-1.2:
Features deprecated in 1.2
@@ -471,10 +481,12 @@ Models can now use a 64 bit :class:`~django.db.models.BigIntegerField` type.
Fast Failure for Tests
----------------------
-The ``test`` subcommand of ``django-admin.py``, and the ``runtests.py`` script
-used to run Django's own test suite, support a new ``--failfast`` option.
-When specified, this option causes the test runner to exit after
-encountering a failure instead of continuing with the test run.
+The :djadmin:`test` subcommand of ``django-admin.py``, and the ``runtests.py``
+script used to run Django's own test suite, support a new ``--failfast`` option.
+When specified, this option causes the test runner to exit after encountering
+a failure instead of continuing with the test run. In addition, the handling
+of ``Ctrl-C`` during a test run has been improved to trigger a graceful exit
+from the test run that reports details of the tests run before the interruption.
Improved localization
---------------------
diff --git a/docs/topics/auth.txt b/docs/topics/auth.txt
index 8aae4f5e73..9874135b02 100644
--- a/docs/topics/auth.txt
+++ b/docs/topics/auth.txt
@@ -34,7 +34,7 @@ Authentication support is bundled as a Django application in
1. Put ``'django.contrib.auth'`` and ``'django.contrib.contenttypes'`` in
your :setting:`INSTALLED_APPS` setting.
- (The :class:`~django.contrib.auth.models.Permisson` model in
+ (The :class:`~django.contrib.auth.models.Permission` model in
:mod:`django.contrib.auth` depends on :mod:`django.contrib.contenttypes`.)
2. Run the command ``manage.py syncdb``.
diff --git a/docs/topics/testing.txt b/docs/topics/testing.txt
index 9ef6cceae8..a309294d7c 100644
--- a/docs/topics/testing.txt
+++ b/docs/topics/testing.txt
@@ -242,8 +242,8 @@ in different circumstances.
Running tests
=============
-Once you've written tests, run them using your project's ``manage.py``
-utility::
+Once you've written tests, run them using the :djadmin:`test` subcommand of
+your project's ``manage.py`` utility::
$ ./manage.py test
@@ -274,6 +274,23 @@ a test case, add the name of the test method to the label::
$ ./manage.py test animals.AnimalTestCase.testFluffyAnimals
+.. versionadded:: 1.2
+ You can now trigger a graceful exit from a test run by pressing ``Ctrl-C``.
+
+If you press ``Ctrl-C`` while the tests are running, the test runner will
+wait for the currently running test to complete and then exit gracefully.
+During a graceful exit the test runner will output details of any test
+failures, report on how many tests were run and how many errors and failures
+were encountered, and destroy any test databases as usual. Thus pressing
+``Ctrl-C`` can be very useful if you forget to pass the :djadminopt:`--failfast`
+option, notice that some tests are unexpectedly failing, and want to get details
+on the failures without waiting for the full test run to complete.
+
+If you do not want to wait for the currently running test to finish, you
+can press ``Ctrl-C`` a second time and the test run will halt immediately,
+but not gracefully. No details of the tests run before the interruption will
+be reported, and any test databases created by the run will not be destroyed.
+
The test database
-----------------