List Info

Thread: RSS Feed Generation




RSS Feed Generation
country flaguser name
United States
2007-02-28 09:50:00

Hi all
Below is my class to generate rss feed for a list
Which is an erroro "class a get_absolute_url() method,
or define an
item_link() method in your Feed class."

Can any one help me with this.

if you send RSS generating code is much appreciated.

Thanx
Prasad


from django.contrib.syndication.feeds import Feed
from django.utils.feedgenerator import Atom1Feed
from nmb.memory.models import nmb_memory_master
from django.utils import feedgenerator


class LatestEntries(Feed):
    item_enclosure_url = None
    feed_type = feedgenerator.DefaultFeed
    title = "Memory List"
    link = "nmb/memory/datewise"
    description = "Updates on changes and additions
Memory List."

    def items(self):
        return nmb_memory_master.get_list()

class AtomSiteNewsFeed(LatestEntries):
    feed_type = Atom1Feed

url.py

(r'^feeds/(?P<url>.*)/$',
'django.contrib.syndication.views.feed',
    {'feed_dict': feeds}),


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "Django users" group.
To post to this group, send email to django-usersgooglegroups.com
To unsubscribe from this group, send email to
django-users-unsubscribegooglegroups.com
For more options, visit this group at htt
p://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: RSS Feed Generation
user name
2007-02-28 21:19:40
On 2/28/07, VirusRaja <prasad.gbgmail.com> wrote:
> Below is my class to generate rss feed for a list
> Which is an erroro "class a get_absolute_url()
method, or define an
> item_link() method in your Feed class."
>
> Can any one help me with this.

The error message is telling you exactly what to do: you
need to give
your class a get_absolute_url() method, or define
item_link() in your
Feed class.

So either::

  class MyModel(Model):
     ...

     def get_absolute_url(self):
       return "/some/url/"

Or, on your Feed class::

  class LatestEntries(Feed):
    ...

    def item_link(self, item):
      return "/some/url/"

Jacob

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "Django users" group.
To post to this group, send email to django-usersgooglegroups.com
To unsubscribe from this group, send email to
django-users-unsubscribegooglegroups.com
For more options, visit this group at htt
p://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---


[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )