1
0
mirror of https://github.com/django/django.git synced 2025-10-24 06:06:09 +00:00

Fixed #19463 -- Added UUIDField

Uses native support in postgres, and char(32) on other backends.
This commit is contained in:
Marc Tamlyn
2014-07-15 10:35:29 +01:00
parent 0d1561d197
commit ed7821231b
17 changed files with 274 additions and 4 deletions

View File

@@ -888,6 +888,20 @@ For each field, we describe the default widget used if you don't specify
These are the same as ``CharField.max_length`` and ``CharField.min_length``.
``UUIDField``
-------------
.. versionadded:: 1.8
.. class:: UUIDField(**kwargs)
* Default widget: :class:`TextInput`
* Empty value: ``''`` (an empty string)
* Normalizes to: A :class:`~python:uuid.UUID` object.
* Error message keys: ``required``, ``invalid``
This field will accept any string format accepted as the ``hex`` argument
to the :class:`~python:uuid.UUID` constructor.
Slightly complex built-in ``Field`` classes
-------------------------------------------