Skip to content

Commit

Permalink
[1.6.x] Documentation - Noted that OneToOneField doesn't respect unique.
Browse files Browse the repository at this point in the history
Added OneToOneField to the list of model fields for which the unique
argument isn't valid. (OneToOneFields are inherently unique, and if
the user supplies a value for unique it is ignored / overwritten.)
  • Loading branch information
marfire authored and ptone committed Aug 21, 2013
1 parent 12d364a commit e7d4d41
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/ref/models/fields.txt
Original file line number Diff line number Diff line change
Expand Up @@ -272,8 +272,8 @@ you try to save a model with a duplicate value in a :attr:`~Field.unique`
field, a :exc:`django.db.IntegrityError` will be raised by the model's
:meth:`~django.db.models.Model.save` method.

This option is valid on all field types except :class:`ManyToManyField` and
:class:`FileField`.
This option is valid on all field types except :class:`ManyToManyField`,
:class:`OneToOneField`, and :class:`FileField`.

Note that when ``unique`` is ``True``, you don't need to specify
:attr:`~Field.db_index`, because ``unique`` implies the creation of an index.
Expand Down

0 comments on commit e7d4d41

Please sign in to comment.