예제 #1
0
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))
예제 #2
0
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))
예제 #3
0
 def setUp(self):
     # Remove any Scrapers created by a fixture
     [x.delete() for x in Scraper.objects.all()]
     self.scrapers = get_overdue_scrapers()
예제 #4
0
 def setUp(self):
     # Remove any Scrapers created by a fixture
     [x.delete() for x in Scraper.objects.all()]
     self.scrapers = get_overdue_scrapers()