Opened 19 years ago
Last modified 18 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)
Change History (33)
comment:1 by , 18 years ago
Triage Stage: | Unreviewed → Design decision needed |
---|
comment:2 by , 18 years ago
Triage Stage: | Design decision needed → Accepted |
---|
comment:3 by , 17 years ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
taking a sprint stab at this, if anyone else wants to help i'm cmcavoy on irc.
comment:4 by , 17 years ago
Cc: | added |
---|
comment:5 by , 17 years ago
Keywords: | feature added |
---|
comment:6 by , 17 years ago
Keywords: | feature_request added; feature removed |
---|
comment:7 by , 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 , 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 , 16 years ago
Owner: | changed from | to
---|---|
Status: | assigned → new |
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.
follow-up: 14 comment:10 by , 16 years ago
Status: | new → assigned |
---|
follow-up: 12 comment:11 by , 16 years ago
Cc: | 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.
comment:12 by , 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 , 16 years ago
Cc: | added; removed |
---|
comment:14 by , 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 , 16 years ago
Cc: | added; 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 , 16 years ago
Attachment: | feeds_patch.diff added |
---|
by , 16 years ago
Attachment: | feedtest_patch.diff added |
---|
comment:17 by , 16 years ago
Has patch: | set |
---|---|
Owner: | changed from | to
Status: | assigned → new |
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 , 16 years ago
Attachment: | feedgenerator_patch.diff added |
---|
comment:18 by , 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 , 15 years ago
Patch needs improvement: | set |
---|
Setting Patch Needs Improvement to True since taojian said it was preliminary.
comment:20 by , 14 years ago
Version: | SVN → 1.2-alpha |
---|
comment:21 by , 14 years ago
Keywords: | feature_request removed |
---|---|
Needs documentation: | set |
Severity: | normal → Normal |
Type: | enhancement → New 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 , 13 years ago
Easy pickings: | unset |
---|---|
Owner: | changed from | to
Status: | new → assigned |
UI/UX: | unset |
comment:23 by , 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?
Edit: If the latter, I can consolidate the 3 patches and write some documentation, if the former I can implement that.
comment:24 by , 13 years ago
Owner: | changed from | to
---|---|
Status: | assigned → new |
comment:25 by , 13 years ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
comment:26 by , 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 , 11 years ago
Keywords: | djangocon added |
---|---|
Owner: | changed from | to
Version: | 1.2-alpha → master |
comment:28 by , 8 years ago
Owner: | removed |
---|---|
Status: | assigned → new |
comment:29 by , 5 years ago
Owner: | set to |
---|---|
Status: | new → assigned |
comment:30 by , 5 years ago
Owner: | removed |
---|---|
Status: | assigned → new |
comment:31 by , 18 months ago
Cc: | added |
---|
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.