Opened 3 years ago

Closed 3 years ago

Last modified 3 years ago

#18145 closed Cleanup/optimization (fixed)

Documentation for unique_together is confusing

Reported by: RoySmith Owned by: raulcd
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 3 years ago by jezdez

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Triage Stage changed from Unreviewed to Accepted

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

comment:2 Changed 3 years ago by raulcd

  • Cc raulcumplido@… added
  • Owner changed from nobody to raulcd

comment:3 Changed 3 years ago by raulcd

  • Has patch set

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

comment:4 Changed 3 years ago by raulcd

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

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

  • Resolution set to fixed
  • Status changed from new to closed

In [55ffcf8e7b414a39e2dfc9c9eb4c5d3fa548e78e]:

Fixed #18145 -- Improved documentation of unique_together type fields

comment:6 Changed 3 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