You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

41 lines
1.0 KiB

#from django.contrib.syndication.views import Feed
#from django.contrib.gis.feeds import Feed
from django.contrib.gis.feeds import Feed
from mumbai.models import *
from django.shortcuts import get_object_or_404
class RouteFeed(Feed):
# description_template = 'feeds/route_description.html'
def get_object(self, request, alias):
return get_object_or_404(Route, alias=alias)
def title(self, obj):
return "ChaloBEST.in: Feed for Bus No.: %s" % obj.alias
def description(self, obj):
return "GeoRSS Route Feed"
def geometry(self, obj):
return obj.from_stop.point
def link(self, obj):
return obj.get_absolute_url()
def items(self, obj):
return Stop.objects.filter(routedetail__route=obj)
def item_title(self, obj):
return obj.display_name
def item_geometry(self, obj):
return obj.point
def item_link(self, obj):
return obj.get_absolute_url()
def item_description(self, obj):
return obj.display_name #FIXME