Code

Opened 5 years ago

Closed 5 years ago

Last modified 3 years ago

#10367 closed (fixed)

Improve docs for `GenericRelation` in `contenttypes`.

Reported by: mrmachine Owned by: kkubasik
Component: Documentation Version: master
Severity: Keywords: GenericRelation GenericForeignKey comments kkmegapatch
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

At least one contrib app uses a non-default value for fk_field in a GenericForeignKey (comments app uses "object_pk", which means users need to specify their reverse generic relation as GenericRelation(Comment, object_id_field="object_pk"), but keyword arguments for GenericRelation are not documented.

Attachments (2)

10367-genericrelation-r9907.diff (970 bytes) - added by mrmachine 5 years ago.
Updated to include an example.
10367-genericrelation-r10591.diff (684 bytes) - added by gsong 5 years ago.
Fixed incorrect GenericRelation example.

Download all attachments as: .zip

Change History (13)

comment:1 Changed 5 years ago by Alex

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

comment:2 Changed 5 years ago by mrmachine

  • Has patch set

Changed 5 years ago by mrmachine

Updated to include an example.

comment:3 Changed 5 years ago by mrmachine

  • milestone set to 1.1 beta
  • Version changed from 1.0-beta-1 to SVN

Incorrectly set version as 1.0 beta, instead of milestone 1.1 beta.

comment:4 Changed 5 years ago by Alex

  • milestone changed from 1.1 beta to 1.1

milestone is 1.1, beta is for features only

comment:5 Changed 5 years ago by kkubasik

  • Keywords kkmegapatch added
  • Owner changed from nobody to kkubasik

comment:6 Changed 5 years ago by ubernostrum

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

(In [10273]) Fixed #10367: Added note to generic-relation docs explaining when it's necessary to pass in field names to create a reverse relation.

comment:7 Changed 5 years ago by ubernostrum

(In [10274]) [1.0.X] Fixed #10367: Added note to generic-relation docs explaining when it's necessary to pass in field names to create a reverse relation. Backport of [10273] from trunk.

Changed 5 years ago by gsong

Fixed incorrect GenericRelation example.

comment:8 Changed 5 years ago by gsong

  • Resolution fixed deleted
  • Status changed from closed to reopened

I think the fix in [10273] actually contained incorrect info about how to use GenericRelation in case of non-default field names.

comment:9 Changed 5 years ago by russellm

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

(In [10659]) Fixed #10367 -- Corrected an example in the documentation for GenericRelation. Thanks to George Song for the patch.

comment:10 Changed 5 years ago by russellm

(In [10661]) [1.0.x] Fixed #10367 -- Corrected an example in the documentation for GenericRelation. Thanks to George Song for the patch.

Merge of r10659 from trunk.

comment:11 Changed 3 years ago by jacob

  • milestone 1.1 deleted

Milestone 1.1 deleted

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.