Opened 12 years ago

Closed 12 years ago

Last modified 12 years ago

#19306 closed Cleanup/optimization (fixed)

Docs: simple example does not work

Reported by: brycenesbitt Owned by: nobody
Component: Documentation Version: 1.4
Severity: Normal Keywords:
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

Implementing 'A simple example' at
https://docs.djangoproject.com/en/dev/ref/contrib/syndication/

Gives error
Give your Entry class a get_absolute_url() method, or define an item_link() method in your Feed class.

Due to a missing 'def item_link(self, item):'

Attachments (1)

19306.diff (930 bytes ) - added by Tim Graham 12 years ago.

Download all attachments as: .zip

Change History (8)

comment:1 by Aymeric Augustin, 12 years ago

The example doesn't include the definition of the model; I suppose it had a get_absolute_url method.

It will be more explicit to import reverse at the beginning of the example and add something like:

    def item_link(self, item):
        return reverse('news-item', args=[item.pk])

comment:2 by Aymeric Augustin, 12 years ago

Triage Stage: UnreviewedAccepted
Type: UncategorizedCleanup/optimization

comment:3 by Claude Paroz, 12 years ago

Also add a comment above the method telling that item_link is only needed if NewsItem has no get_absolute_url.

by Tim Graham, 12 years ago

Attachment: 19306.diff added

comment:4 by Tim Graham, 12 years ago

Has patch: set

comment:5 by Claude Paroz, 12 years ago

Triage Stage: AcceptedReady for checkin

comment:6 by Tim Graham <timograham@…>, 12 years ago

Resolution: fixed
Status: newclosed

In 1f1f60d12f78ee68d59b577fdb6a31857b1d0f44:

Fixed #19306 - Improved syndication example.

Thanks brycenesbitt for the report.

comment:7 by Tim Graham <timograham@…>, 12 years ago

In 17c61aaea303a5f21537d9978c28135f6f17b489:

[1.5.X] Fixed #19306 - Improved syndication example.

Thanks brycenesbitt for the report.

Backport of 1f1f60d12f from master

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