Code

Opened 5 years ago

Closed 4 years ago

Last modified 4 years ago

#11973 closed (fixed)

Syndication framework documentation refers to "copyright" attribute rather than "feed_copyright"

Reported by: peppergrower Owned by: nobody
Component: contrib.syndication Version: 1.1
Severity: Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation:
Needs tests: Patch needs improvement:
Easy pickings: UI/UX:

Description

Django's syndication framework documentation (http://docs.djangoproject.com/en/dev/ref/contrib/syndication/) says that in order to include a copyright notice in your feed (at the feed level), you can either define copyright() or hard-code a copyright variable. However, I did so and then checked the resulting XML output of my Atom feed, and the copyright information wasn't included anywhere.

After looking at django/utils/feedgenerator.py, I realized that it was looking for feed_copyright() (or a feed_copyright variable), not copyright(). After changing my Feed class to define feed_copyright(), it showed up in the feed as expected.

There are two ways to resolve this: change the documentation, or change the code. Changing the documentation is the easiest approach. On the other hand, changing the code would make this method slightly more consistent with the other methods/attributes defined (most of which have a bare name, e.g., title(), and then are prefixed with item_ for the corresponding item-level method, e.g., item_title().) It would, however, break backward compatibility.

I suggest replacing references in the documentation to "copyright" with "feed_copyright".

Attachments (0)

Change History (2)

comment:1 Changed 4 years ago by russellm

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

(In [12338]) Fixed #6188, #6304, #6618, #6969, #8758, #8989, #10334, #11069, #11973 and #12403 -- Modified the syndication framework to use class-based views. Thanks to Ben Firshman for his work on this patch.

comment:2 Changed 4 years ago by russellm

(In [12339]) [1.1.X] Fixed #11973 -- Corrected some misleading documentation regarding the feed_copyright attribute on feeds.

Backport of a small part of r12338 from trunk.

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.