#6547: Support GeoRSS in syndication of Geographic Models
-------------------------------+--------------------------------------------
Reporter: jbronn | Owner: jbronn
Status: assigned | Milestone: 1.0 beta
Component: GIS | Version: gis
Resolution: | Keywords: gis georss feed rss
Stage: Accepted | Has_patch: 0
Needs_docs: 0 | Needs_tests: 0
Needs_better_patch: 0 |
-------------------------------+--------------------------------------------
Comment (by rcoup):
I looked at this a bit tonight (because I want to generate some GeoRSS
feeds)... comments are below. Mostly referring to Atom but similar
concepts apply to RSS - noted in (brackets):
* creating a subclass of `django.contrib.syndication.feeds.Feed` with
`item_location` and `location` parameters won't be a problem to extract a
geometry field from a model
* the problem comes with respect to
`django.utils.feedgenerator.SyndicationFeed`:
* we want to add a `<georss:where>` clause to the feed(channel), each
entry(item), or both.
* we need to add the `georss` namespace declaration to `<feed>`
(`<channel>`)
* there are no hooks for extending either the feed or the entry, which
means we'd have to reimplement/duplicate the entire `write()` and
`write_items()` for each feed format. :(
Ok, so that's not gonna happen.
Extensions I think should be added to `SyndicationFeed` & its
implementations to allow us to GeoRSS-ify stuff:
* `SyndicationFeed.__init__()` and `SyndicationFeed.add_item()` should
take `kwargs` which are added into the feed/item dictionaries
respectively.
* `extra_attrs()`: Add attributes to the root `feed`(`channel`) element.
eg. `xmlns:georss="http://..."`. Returns a dictionary. Called from
`write()`
* `extras(handler)`: Add elements within the `feed`(`channel`) element.
eg. a `<georss:where>` for the feed. Called from `write()`
* `item_extra_attrs(item)`: Add attributes to the `entry`(`item`)
elements (called once for each item). Returns a dictionary. Called from
`write_items()`
* `item_extras(handler, item)`: Add elements within the `entry`(`item`)
elements (called once for each item). Would be where the georss would be
added. Called from `write_items()`
Once we have those hooks we can do a mixin with each of the existing
SyndicationFeed implementations and a GeoRSS implementation that knows how
to turn a geometry object into a suitable GeoRSS clause. It would not just
do georss then, but could also do `media:` or any other extensions. Thats
quite a sizeable set of changes though, so I guess we need to bring it up
on django-dev, and who knows whether it'll get through pre-1.0. I think
those hooks make things much more flexible without needing to go to the
lengths of rewriting the whole framework.
See also:
* #3569
* http://code.google.com/p/django-atompub/wiki/UserGuide
Probably should be another ticket, but I thought i'd get some initial
feedback first.
--
Ticket URL: <http://code.djangoproject.com/ticket/6547#comment:5>
Django Code <http://code.djangoproject.com/>
The web framework for perfectionists with deadlines
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---