Search code examples
djangorssfeed

getting the querysting in django's feed class


I want to be able to have an rss feed with an querysting. For example example.com/rss/bbox?=39.715056,-75.811158,39.5098,-75.491781

  1. I couldn't find any example of rss with querystrings, is this proper?
  2. How do I get the arguments using django's feed class?

Solution

  • Found it! the get_object method is passed request which you then can extract the GET arguments.

    def get_object(self, request, *args, **kwargs):
        bounds = request.GET.get("bbox")
        bbox = _str_to_bbox(bounds)
        ....
        return Obj
    

    The returned object can then be used in items and most the rest of the feed class's methods