Skip to content
This repository


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Documentation - Noted that OneToOneField doesn't respect unique.

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...
commit 7775ced938da18066da73adba322be1a49be3e6d 1 parent c5fbd16
Kevin Christopher Henry authored andrewgodwin committed

Showing 1 changed file with 2 additions and 2 deletions. Show diff stats Hide diff stats

  1. 4  docs/ref/models/fields.txt
4  docs/ref/models/fields.txt
@@ -281,8 +281,8 @@ you try to save a model with a duplicate value in a :attr:`~Field.unique`
281 281
 field, a :exc:`django.db.IntegrityError` will be raised by the model's
282 282
 :meth:`` method.
283 283
-This option is valid on all field types except :class:`ManyToManyField` and
+This option is valid on all field types except :class:`ManyToManyField`,
+:class:`OneToOneField`, and :class:`FileField`.
286 286
287 287
 Note that when ``unique`` is ``True``, you don't need to specify
288 288
 :attr:`~Field.db_index`, because ``unique`` implies the creation of an index.

0 notes on commit 7775ced

Please sign in to comment.
Something went wrong with that request. Please try again.