Here is a url containing the hash for a super-secret feed:
http://127.0.0.1:8000/something/feed/12e8e59187c328fbe5c48452babf769c/
I am trying to capture and send the variable '12e8e59187c328fbe5c48452babf769c'
which is feed_hash
(acts as a slug to retrieve the particular entry)
Based on the example in django-syndication, I've created this simple class in feeds.py
class SomeFeed(Feed):
title = 'feed title '+request.feed_hash #just testing
link = "/feed/"
description = "Feed description"
def items(self):
return Item.objects.order_by('-published')[:5]
def item_title(self, item):
return item.title
def item_description(self, item):
return item.content
# item_link is only needed if NewsItem has no get_absolute_url method.
def item_link(self, item):
return 'link'
Hence I am wondering, how would I modify this to get a model according to the hash?
At this time I cannot access the 12e8e59187c328fbe5c48452babf769c
in any way. How might I access this and -- in a standard Django way -- create a feed from the retrieved variable (which represents a slug accessing a many-to-many relationship.)