I have a legacy app with feeds:

/restaurant/{slug}/feed

so I defined in my urls.py:


feeds = {
    'restaurant'    : MenuItems,
}

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

That goes to the correct class, but how do I get at the slug?  I tried
using:

class MenuItems(Feed):
    """
    e.g. /restaurant/hobees/feed

    We need the equivalent of
    select menuitems from menuitems, restaurants where restaurant.slug
= slug
    """

    def get_object(self, bits):
        return Restaurant.objects.get(stripped_title__exact=bits[0])


but I suspect that Restaurant.objects.get was returning None since I
got the following error:

'NoneType' object has no attribute 'get_absolute_url'

Thanks for any help :)


--~--~---------~--~----~------------~-------~--~----~
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?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to