Example #1
0
def home(request):

    last_month = add_months(now().date(), -1)

    return render(request, 'contracts/main_page.html', {
        'latest_contracts': models.Contract.objects
            .filter(signing_date__gt=last_month).order_by('-price')[:5],
        'latest_entities': models.Entity.objects.order_by('-data__last_activity', '-id')[:5],
        'latest_tenders': models.Tender.objects.order_by('-id')[:5],
        'latest_analysis': analysis_list()[-5:],
        'REQUIRE_D3JS': True})
Example #2
0
def home(request):

    last_month = add_months(now().date(), -1)

    return render(
        request, 'contracts/main_page.html', {
            'latest_contracts':
            models.Contract.objects.filter(
                signing_date__gt=last_month).order_by('-price')[:5],
            'latest_entities':
            models.Entity.objects.order_by('-data__last_activity', '-id')[:5],
            'latest_tenders':
            models.Tender.objects.order_by('-id')[:5],
            'latest_analysis':
            analysis_list()[-5:],
            'REQUIRE_D3JS':
            True
        })
Example #3
0
def home(request):

    today = now().date()
    last_month = add_months(today, -1)

    latest_contracts = models.Contract.objects.filter(signing_date__gt=last_month).order_by("-price")[:5]

    latest_entities = models.Entity.objects.order_by("-id")[:5]

    latest_tenders = models.Tender.objects.order_by("-id")[:5]

    latest_analysis = analysis_list()[-5:]

    return render(
        request,
        "contracts/main_page.html",
        {
            "latest_contracts": latest_contracts,
            "latest_entities": latest_entities,
            "latest_tenders": latest_tenders,
            "latest_analysis": latest_analysis,
        },
    )