Opened 19 years ago

Last modified 19 months ago

#1028 new New feature

High-level feed framework should make more feed elements available

Reported by: James Bennett Owned by:
Component: contrib.syndication Version: dev
Severity: Normal Keywords: djangocon
Cc: toke-django@…, dan90., girzel@…, Matt Goldman Triage Stage: Accepted
Has patch: yes Needs documentation: yes
Needs tests: no Patch needs improvement: yes
Easy pickings: no UI/UX: no

Description

Currently, certain RSS and Atom elements can be populated only by making use of the "low-level" feed framework; this is particularly annoying in the case of certain common items such as the RSS category element. Ideally, all valid elements could be populated by use of the high-level framework, but in practice perhaps it would be best simply to determine which elements are needed in the most common use cases, and provide access to them.

One possible implementation would be to extend the high-level framework's use of the template system; instead of providing templates for the title and description elements, perhaps the high-level framework could allow specification of a template for the complete item element. For example, a publisher who wished to list the categories to which items belong would be able to include this in the template for items in an RSS feed:

{% for category in obj.get_category_list %}
<category>{{ category }}</category>
{% endfor %}

Attachments (3)

feeds_patch.diff (1.8 KB ) - added by Eric Abrahamsen 16 years ago.
feedtest_patch.diff (740 bytes ) - added by Eric Abrahamsen 16 years ago.
feedgenerator_patch.diff (5.4 KB ) - added by Eric Abrahamsen 16 years ago.

Download all attachments as: .zip

Change History (33)

comment:1 by Simon G. <dev@…>, 18 years ago

Triage Stage: UnreviewedDesign decision needed

comment:2 by Malcolm Tredinnick, 18 years ago

Triage Stage: Design decision neededAccepted

I don't know if the template approach is the correct one, but the sentiment of the bug report is correct: we are a bit restricted when it comes to creating full feeds.

comment:3 by cmcavoy, 17 years ago

Owner: changed from nobody to cmcavoy
Status: newassigned

taking a sprint stab at this, if anyone else wants to help i'm cmcavoy on irc.

comment:4 by Thomas Kerpe, 17 years ago

Cc: toke-django@… added

comment:5 by Philippe Raoult, 17 years ago

Keywords: feature added

comment:6 by Philippe Raoult, 17 years ago

Keywords: feature_request added; feature removed

in reply to:  description comment:7 by mikechambers, 17 years ago

Replying to ubernostrum:

Try to document which RSS elements are not supported.

Looking at the RSS 2 spec:

http://blogs.law.harvard.edu/tech/rss

and

django.utils.feedgenerator.Rss201rev2Feed / RssFeed

It appears the the following optional rss.channel are missing:

managingEditor
webMaster
pubDate
generator
docs
cloud
image
rating
textInput
skpiHours
skipDays

comment:8 by mikechambers, 17 years ago

That is "I am trying to document which RSS elements are not supported". I will go over item elements next.

comment:9 by Erik Karulf, 16 years ago

Owner: changed from cmcavoy to Erik Karulf
Status: assignednew
Version: SVN

RSS 2.0 Missing Elements:

Compared RSS 2.0 Spec against [source:django/trunk/django/utils/feedgenerator.py#7066 feedgenerator.py(r7066)]'s Rss201rev2Feed class

  • Channel
    • managingEditor
    • webMaster
    • pubDate
    • generator
    • docs
    • cloud
    • image
    • rating
    • textInput
    • skipHours
    • skipDays
  • Item
    • Currently contains TTL field, not specified in RSS 2.0 spec
    • pubDate
    • source

I'll take a shot at this later in the week, since I assume cmcavoy was not able to finish at the last sprint.

comment:10 by Erik Karulf, 16 years ago

Status: newassigned

comment:11 by dan <dan@…>, 16 years ago

Cc: dan@… added

Other things to think off include the entire idea of the extensibility of RSS - embedding [geographical information], say. Or is that getting off-topic?

More generally, as an RDF format, RSS 1.0 potentially includes the entire world of RDF as embeddable info, although presumably the humble django feed framework is not intended to encompass all of that.

in reply to:  11 comment:12 by Erik Karulf, 16 years ago

Replying to dan <dan@possumpalace.org>:

Other things to think off include the entire idea of the extensibility of RSS - embedding [geographical information], say. Or is that getting off-topic?

More generally, as an RDF format, RSS 1.0 potentially includes the entire world of RDF as embeddable info, although presumably the humble django feed framework is not intended to encompass all of that.

I think that might be getting a bit off topic. The syndication code defines the various feed formats using OO-style inheritance. I think that if someone wanted to embed geographical info (or any other bits) they could accomplish it using the existing framework. That said, I will see if I can't leave a hook to make extending more flexible.

comment:13 by dan, 16 years ago

Cc: dan added; dan@… removed

in reply to:  10 comment:14 by Eric Abrahamsen, 16 years ago

It would also be very nice to be able to specify feed stylesheets:

<?xml-stylesheet type="text/css" href="http://example.com/rss.css" ?>

class MyFeed(Feed):
    stylesheet = 'http://example.com/rss.css'

Unless this is already possible...?

comment:16 by Eric Abrahamsen, 16 years ago

Cc: dan90. girzel@… added; dan removed

Looks like this is stalled again. I've got a basic patch for this mostly complete, adding these channel-level elements:

managing_editor
webmaster
generator
image
stylesheet
rating
cloud
skip_hours
skip_days

The others seemed esoteric or not useful. If anyone's got any half-complete patches lying around maybe we can consolidate them, otherwise I'll post a complete patch tomorrow.

by Eric Abrahamsen, 16 years ago

Attachment: feeds_patch.diff added

by Eric Abrahamsen, 16 years ago

Attachment: feedtest_patch.diff added

comment:17 by Eric Abrahamsen, 16 years ago

Has patch: set
Owner: changed from Erik Karulf to Eric Abrahamsen
Status: assignednew

There goes a preliminary patch, plus a slight tweak to the syndication tests. Docs to follow once there's some consensus that these are the right elements to add. I ended up leaving out rating, because half an hour of reading was insufficient to make sense of the specification, and it looks like something that isn't used all that much.

Other issues: Django now reports itself as the generator, unless generator is specifically overridden. I don't think django makes itself known in any other part of user output, so this might be undesirable. Also, the RSS specification has the cloud tag as an empty-element (self-closing) tag, but I couldn't get the xml generator to make anything other than a pair of open/close tags. From what I've read of the specs, this should be equally acceptable.

by Eric Abrahamsen, 16 years ago

Attachment: feedgenerator_patch.diff added

comment:18 by Eric Abrahamsen, 16 years ago

Realized that the feedgenerator patch was RSS-centric: the stylesheet now goes on Atom feeds as well, and there's support for an icon element for Atom. Generator syntax is totally different for RSS and Atom; if we want to support that there will have to be separate attributes available for override.

comment:19 by Adam Nelson, 15 years ago

Patch needs improvement: set

Setting Patch Needs Improvement to True since taojian said it was preliminary.

comment:20 by anonymous, 15 years ago

Version: SVN1.2-alpha

comment:21 by Łukasz Rekucki, 14 years ago

Keywords: feature_request removed
Needs documentation: set
Severity: normalNormal
Type: enhancementNew feature

None of the patches include any docs. I'm also lost which patches are supposed to be applied - it's best to keep everything in one patch.

comment:22 by Mark Barrett, 13 years ago

Easy pickings: unset
Owner: changed from Eric Abrahamsen to Mark Barrett
Status: newassigned
UI/UX: unset

comment:23 by Mark Barrett, 13 years ago

What's the consensus with regards to the solution for this? i.e. will be going with the template approach described above, or with the simpler solution implemented by taojian?

Version 0, edited 13 years ago by Mark Barrett (next)

comment:24 by Mark Barrett, 13 years ago

Owner: changed from Mark Barrett to nobody
Status: assignednew

comment:25 by tylerdavis, 13 years ago

Owner: changed from nobody to tylerdavis
Status: newassigned

comment:26 by tylerdavis, 13 years ago

Hello all. This is my first attempt at working on a ticket, so thank you very much for your patience. I was hoping anyone that may have been involved with this ticket in the past could fill me in on what the specific goals are here. Obviously, I understand that the framework doesn't support all the currently supported rss 2.0 elements. It looks like the current patches have addressed that for the most part? What can I do to help complete this?

Thanks again

comment:27 by Dariusz Paluch, 12 years ago

Keywords: djangocon added
Owner: changed from tylerdavis to Dariusz Paluch
Version: 1.2-alphamaster

comment:28 by dpaluch-rp, 8 years ago

Owner: Dariusz Paluch removed
Status: assignednew

comment:29 by Tom Carrick, 5 years ago

Owner: set to Tom Carrick
Status: newassigned

comment:30 by Tom Carrick, 5 years ago

Owner: Tom Carrick removed
Status: assignednew

comment:31 by Matt Goldman, 19 months ago

Cc: Matt Goldman added
Note: See TracTickets for help on using tickets.
Back to Top