I'm looking but I don't see anything you are doing wrong. It's been a while since I implemented my feeds and I vaguely remember maybe getting an error like that at one point. What you have looks a lot like what I have that works though. Sorry, I'm not helping much here, but I guess I didn't want you to think you're being ignored.
Bryan On 3/24/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > Hi. > > I'm trying to put together a feed for a specific blog in my system. > I've been following the example at > http://www.djangoproject.com/documentation/syndication/#a-complex-example > > Unfortunately, when I access the feed, I get: > > - - - - - - - - - - - - - - - - - - - - - - - - > TypeError at /rss/blog/1/ > items() takes exactly 2 arguments (1 given) > Request Method: > GET > Request URL: > http://localhost:8000/rss/blog/1/ > Exception Type: > TypeError > Exception Value: > items() takes exactly 2 arguments (1 given) > Exception Location: > /usr/lib/python2.4/site-packages/Django-0.91-py2.4.egg/django/contrib/syndication/feeds.py > in __get_dynamic_attr, line 38 > - - - - - - - - - - - - - - - - - - - - - - - - > > Here's the feed implementation: > > - - - - - - - - - - - - - - - - - - - - - - - - > # Die neuesten Einträge in einem bestimmten Blog > class BlogFeed(Feed): > > def get_object(self, bits): > if len(bits) != 1: > raise ObjectDoesNotExist > return blogs.get_object(id__exact=bits[0]) > > def title(self, obj): > return "www.trogger.de - Neue Beiträge in %s" % obj.title > > def link(self, obj): > return "/world/blog/%s" % obj.id > > def description(self, obj): > return "Neue Einträge in %s -- Blog von %s" % ( obj.title, > obj.get_author().get_full_name) > > def items(self, obj): > return submissions.get_list(blog__id__exact = obj.id, > order_by=('-date_submitted',), limit=5) > - - - - - - - - - - - - - - - - - - - - - - - - > > According to the docs, the RSS framework should be calling my > "items(self, obj):" method. Unfortunately, it seems to be only looking > for "items(self)", which isn't there. > > My feeds definition is: > feeds = { > 'travelreports': LatestTravelReports, > 'newblogs': NewBlogs, > 'blog': BlogFeed, > 'blogentries': LatestBlogEntries, > } > > so for /rss/blog/1/ it should be calling my BlogFeed implementation. > > The "simple" feeds (with no parameters) work fine, by the way. > > Django release is "Django-0.91-py2.4.egg" > > Can someone please point out my mistake? I'm sure it's a case of not > seeing the forest for the trees. > > Thanks, > > Daniel > > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~----------~----~----~----~------~----~------~--~---