Author: mtredinnick Date: 2007-10-20 07:35:10 -0500 (Sat, 20 Oct 2007) New Revision: 6566
Modified: django/trunk/docs/model-api.txt Log: Fixed #4944 -- Added a note about Model.save() raising IntegrityError is a 'unique' constraint is violated. Patch from PhiR. Modified: django/trunk/docs/model-api.txt =================================================================== --- django/trunk/docs/model-api.txt 2007-10-20 12:29:56 UTC (rev 6565) +++ django/trunk/docs/model-api.txt 2007-10-20 12:35:10 UTC (rev 6566) @@ -149,7 +149,7 @@ 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`` ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -678,7 +678,9 @@ 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`` ~~~~~~~~~~~~~~~~~~~ @@ -1584,8 +1586,8 @@ 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:: --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django updates" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-updates?hl=en -~----------~----~----~----~------~----~------~--~---
