Opened 7 years ago

Closed 5 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 julianb 7 years ago.
Makes templates optional + includes the fix for #6533

Download all attachments as: .zip

Change History (9)

comment:1 Changed 7 years ago by Simon Greenhill

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

comment:2 Changed 7 years ago by julianb

  • Owner changed from nobody to julianb
  • Status changed from new to assigned

Changed 7 years ago by julianb

Makes templates optional + includes the fix for #6533

comment:3 Changed 7 years ago by julianb

  • Has patch set

comment:4 Changed 7 years ago by mtredinnick

  • milestone set to post-1.0

comment:5 Changed 7 years ago by aalbrecht

  • Cc albrecht.andi@… added

comment:6 Changed 6 years ago by anonymous

  • milestone post-1.0 deleted

Milestone post-1.0 deleted

comment:7 Changed 6 years ago by julianb

  • Owner julianb deleted
  • Status changed from assigned to new

comment:8 Changed 5 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.

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