def update(request): feed = eval("request." + request.method + "['feed']") try: feed = Feed.objects.get(id=feed) except Feed.DoesNotExist: return HttpResponseRedirect('/feeds') update_feeds(feed) return HttpResponseRedirect('/feeds')
def update(request, id): try: feed = Feed.objects.get(id=id) except Feed.DoesNotExist: return HttpResponseRedirect('/reader/') update_feeds(feed) cache.delete('ar') if request.is_ajax(): return HttpResponse('%s yay!' % id) return HttpResponseRedirect('/reader/')
def update_all(request): for feed in Feed.objects.filter(user=request.user): update_feeds(feed) return HttpResponseRedirect('/')