Esempio n. 1
0
def index(request):
    articles = Job.objects.filter(
        published__lt=datetime.now()).exclude(
        deadline__lt=datetime.now()).order_by('-published')
    paginator = Paginator(articles, NUM_JOBS)

    page = request.GET.get('page')
    try:
        latest = paginator.page(page)
    except PageNotAnInteger:
        latest = paginator.page(1)
    except EmptyPage:
        latest = paginator.page(paginator.num_pages)

    feed_job_list = get_feed_articles('job_feed_articles', JobFeed)

    return render_to_response('jobs/index.html', RequestContext(request, {
        'active_tab': 'jobs',
        'subtitle': 'Jobs',
        'job_list': latest,
        'feed_job_list': feed_job_list,
        'partners': []
        }))
Esempio n. 2
0
 def get_articles():
     return get_feed_articles('planet_articles', PlanetFeed)