.. _topics-fields:

=============
Django fields
=============

.. admonition:: About this document

   This document describes additional Django fields provided by Softwarefabrica Django
   Utils.

.. contents::
   :depth: 3

Fields
======

``UUIDField``
-------------

Provided by the module ``softwarefabrica.django.utils.UUIDField``.

This field implements an `UUID`_ Django database field, which can be used as the
primary key in database models. The uniqueness property allows for instance the
implementation of synchronization algorithms for disconnected operations.

Example usage::

    from softwarefabrica.django.utils.UUIDField import UUIDField

    class Wiki(models.Model):
        uuid = UUIDField(_("uuid"), primary_key=True, db_index=True)
        ...

.. _`UUID`: http://en.wikipedia.org/wiki/UUID
