Django

Code

Changeset 6566

Show
Ignore:
Timestamp:
10/20/07 07:35:10 (11 months ago)
Author:
mtredinnick
Message:

Fixed #4944 -- Added a note about Model.save() raising IntegrityError is a
'unique' constraint is violated. Patch from PhiR.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/trunk/docs/model-api.txt

    r6381 r6566  
    150150provide consistency throughout Django. There is full legacy support for 
    151151the old ``maxlength`` argument, but ``max_length`` is preferred. 
    152          
     152 
    153153``CommaSeparatedIntegerField`` 
    154154~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
     
    679679If ``True``, this field must be unique throughout the table. 
    680680 
    681 This is enforced at the database level and at the Django admin-form level. 
     681This is enforced at the database level and at the Django admin-form level. If 
     682you try to add save a model with a duplicate value in a ``unique`` field, a 
     683``django.db.IntegrityError`` will be raised by the model's ``save()`` method. 
    682684 
    683685``unique_for_date`` 
     
    15851587Set ``list_filter`` to activate filters in the right sidebar of the change list 
    15861588page of the admin. This should be a list of field names, and each specified 
    1587 field should be either a ``BooleanField``, ``CharField``, ``DateField``,  
    1588 ``DateTimeField``, ``IntegerField`` or ``ForeignKey``.  
     1589field should be either a ``BooleanField``, ``CharField``, ``DateField``, 
     1590``DateTimeField``, ``IntegerField`` or ``ForeignKey``. 
    15891591 
    15901592This example, taken from the ``django.contrib.auth.models.User`` model, shows