def status(request): if not request.user.is_staff: return HttpResponseRedirect( reverse('dashboard') ) recenteventsmax = 20 recentevents = ScraperRunEvent.objects.all().order_by('-run_started')[:recenteventsmax] context = { 'events':recentevents, 'eventsmax':recenteventsmax } context['overdue_count'] = get_overdue_scrapers().count() return render_to_response('codewiki/status.html', context, context_instance=RequestContext(request))
def status(request): if not request.user.is_staff: return HttpResponseRedirect(reverse('profile', kwargs=dict(username=request.user.username))) recenteventsmax = 20 recentevents = ScraperRunEvent.objects.all().order_by('-run_started')[:recenteventsmax] context = { 'events':recentevents, 'eventsmax':recenteventsmax } context['overdue_count'] = get_overdue_scrapers().count() return render_to_response('codewiki/status.html', context, context_instance=RequestContext(request))
def setUp(self): # Remove any Scrapers created by a fixture [x.delete() for x in Scraper.objects.all()] self.scrapers = get_overdue_scrapers()