#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)
Change History (8)
comment:1 by , 13 years ago
comment:2 by , 13 years ago
| Triage Stage: | Unreviewed → Accepted |
|---|---|
| Type: | Uncategorized → Cleanup/optimization |
comment:3 by , 13 years ago
Also add a comment above the method telling that item_link is only needed if NewsItem has no get_absolute_url.
by , 13 years ago
| Attachment: | 19306.diff added |
|---|
comment:4 by , 13 years ago
| Has patch: | set |
|---|
comment:5 by , 13 years ago
| Triage Stage: | Accepted → Ready for checkin |
|---|
comment:6 by , 13 years ago
| Resolution: | → fixed |
|---|---|
| Status: | new → closed |
Note:
See TracTickets
for help on using tickets.
The example doesn't include the definition of the model; I suppose it had a
get_absolute_urlmethod.It will be more explicit to import
reverseat the beginning of the example and add something like:def item_link(self, item): return reverse('news-item', args=[item.pk])