Skip to content

Commit

Permalink
Fixed #4944 -- Added a note about Model.save() raising IntegrityError…
Browse files Browse the repository at this point in the history
… is a

'unique' constraint is violated. Patch from PhiR.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@6566 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information
malcolmt committed Oct 20, 2007
1 parent cc6139a commit d1efe9b
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions docs/model-api.txt
Expand Up @@ -149,7 +149,7 @@ and in Django's validation.
Django veterans: Note that the argument is now called ``max_length`` to
provide consistency throughout Django. There is full legacy support for
the old ``maxlength`` argument, but ``max_length`` is preferred.

``CommaSeparatedIntegerField``
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Expand Down Expand Up @@ -678,7 +678,9 @@ set.

If ``True``, this field must be unique throughout the table.

This is enforced at the database level and at the Django admin-form level.
This is enforced at the database level and at the Django admin-form level. If
you try to add save a model with a duplicate value in a ``unique`` field, a
``django.db.IntegrityError`` will be raised by the model's ``save()`` method.

``unique_for_date``
~~~~~~~~~~~~~~~~~~~
Expand Down Expand Up @@ -1584,8 +1586,8 @@ Finally, note that in order to use ``list_display_links``, you must define

Set ``list_filter`` to activate filters in the right sidebar of the change list
page of the admin. This should be a list of field names, and each specified
field should be either a ``BooleanField``, ``CharField``, ``DateField``,
``DateTimeField``, ``IntegerField`` or ``ForeignKey``.
field should be either a ``BooleanField``, ``CharField``, ``DateField``,
``DateTimeField``, ``IntegerField`` or ``ForeignKey``.

This example, taken from the ``django.contrib.auth.models.User`` model, shows
how both ``list_display`` and ``list_filter`` work::
Expand Down

0 comments on commit d1efe9b

Please sign in to comment.