Opened 9 years ago

Closed 7 years ago

#6618 closed (fixed)

Make use of templates in feeds.py optional

Reported by: christoph.neuroth@… Owned by:
Component: contrib.syndication Version: master
Severity: Keywords:
Cc: albrecht.andi@… Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

When creating a feed you have to specify title, description and link for each item. For the link this is really easy by overriding the item_link method, which is called for every item.

def item_link(self, obj):
  return '/feed/'+str(obj.id)

However for the description and title fields you have to create two template files which in most cases will consist of only a single line of code("{{ obj.foo }}"). IMHO this is extremely ugly - it would be much nicer if you could just overide one method similar to item_link:

def item_title(self, obj):
  return obj.header
def item_description(self, obj):
  return obj.teaser

Attachments (1)

syndication-optionaltemplates.diff (4.3 KB) - added by Julian Bez 8 years ago.
Makes templates optional + includes the fix for #6533

Download all attachments as: .zip

Change History (9)

comment:1 Changed 8 years ago by Simon Greenhill

Triage Stage: UnreviewedAccepted

comment:2 Changed 8 years ago by Julian Bez

Owner: changed from nobody to Julian Bez
Status: newassigned

Changed 8 years ago by Julian Bez

Makes templates optional + includes the fix for #6533

comment:3 Changed 8 years ago by Julian Bez

Has patch: set

comment:4 Changed 8 years ago by Malcolm Tredinnick

milestone: post-1.0

comment:5 Changed 8 years ago by Andi Albrecht

Cc: albrecht.andi@… added

comment:6 Changed 8 years ago by (none)

milestone: post-1.0

Milestone post-1.0 deleted

comment:7 Changed 8 years ago by Julian Bez

Owner: Julian Bez deleted
Status: assignednew

comment:8 Changed 7 years ago by Russell Keith-Magee

Resolution: fixed
Status: newclosed

(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.

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