Opened 5 years ago

Closed 4 years ago

Last modified 4 years ago

#18145 closed Cleanup/optimization (fixed)

Documentation for unique_together is confusing

Reported by: Roy Smith Owned by: Raúl Cumplido
Component: Documentation Version: 1.4
Severity: Normal Keywords:
Cc: raulcumplido@… Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: yes UI/UX: no

Description

At https://docs.djangoproject.com/en/1.4/ref/models/options/#unique-together, it says:

Sets of field names that, taken together, must be unique:

unique_together = (("driver", "restaurant"),)

This is a list of lists of fields that must be unique when considered together.

The words "set", and "list" refer to specific python datastructures, and the example uses neither of those -- it uses tuples. This should be cleaned up. I suspect the proper wording is "a iterable of iterables".

Change History (6)

comment:1 Changed 5 years ago by Jannis Leidel

Triage Stage: UnreviewedAccepted

I'd say "tuple of two-tuples", but yeah, this is slightly imprecise.

comment:2 Changed 5 years ago by Raúl Cumplido

Cc: raulcumplido@… added
Owner: changed from nobody to Raúl Cumplido

comment:3 Changed 5 years ago by Raúl Cumplido

Has patch: set

fixed at github with pull request at:
https://github.com/django/django/pull/118

comment:4 Changed 4 years ago by Raúl Cumplido

New commit added to the pull request with a little modification from the comments:
https://github.com/django/django/pull/118

comment:5 Changed 4 years ago by Tim Graham <timograham@…>

Resolution: fixed
Status: newclosed

In [55ffcf8e7b414a39e2dfc9c9eb4c5d3fa548e78e]:

Fixed #18145 -- Improved documentation of unique_together type fields

comment:6 Changed 4 years ago by Tim Graham <timograham@…>

In [342e8a6246d0c3893ecbe80584f30d6d0f05aa6f]:

[1.4.X] Fixed #18145 -- Improved documentation of unique_together type fields

Backport of 55ffcf8e7b from master

Note: See TracTickets for help on using tickets.
Back to Top