Opened 2 years ago

Closed 2 years ago

Last modified 2 years ago

#20561 closed Uncategorized (fixed)

QuerySet .distinct([*fields]) documentation improvements

Reported by: jtiai Owned by: nobody
Component: Documentation Version: 1.5
Severity: Normal Keywords:
Cc: Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

QuerySet does have .distinct([*fields]) method has optional feature to provide fields that are used on distinct. This feature is supported only by PostgreSQL.

In documentation there is a small note about fields being supported in PostgreSQL only. Almost all examples though uses fields provided which works only in PostgreSQL. It gives impression if reader does just a quick look of examples that passing parameters is common operation which works everywhere.

Examples should use common format that works for everybody and with a note add database spesifics.

Change History (3)

comment:1 Changed 2 years ago by akaariai

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

I think there is room for some improvement here. Maybe the whole thing should be split to .distinct() and .distinct(*fields)?

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

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

In 577b0f91894469872974ad609b4fabca949cdc1b:

Fixed #20561 -- Emphasized that QuerySet.distinct([*fields]) is only supported by Postgres.

Thanks jtiai for the suggestion.

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

In 430aae1b0db9fbcc15415b7bd9a14df1d88359cf:

[1.6.x] Fixed #20561 -- Emphasized that QuerySet.distinct([*fields]) is only supported by Postgres.

Thanks jtiai for the suggestion.

Backport of 577b0f9189 from master.

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