Esempio n. 1
0
def index(request):
    gallery = Gallery.objects.order_by('-created_at')[0]
    gallery_photos = first_photos(gallery, 12)
    slider = MainSlider.objects.all()[:10]
    edito = Edito.objects.order_by('-created_at')[0]
    return render(request, 'index.html', {
        'gallery': gallery,
        'gallery_photos': gallery_photos,
        'oneofeach': oneofeach(),
        'last_articles': last_articles(20),
        'edito': edito,
        'slider': slider,
        })
Esempio n. 2
0
def index(request):
    gallery = Gallery.objects.order_by('-created_at')[0]
    gallery_photos = first_photos(gallery, 12)
    slider = MainSlider.objects.all()[:10]
    edito = Edito.objects.order_by('-created_at')[0]
    return render(
        request, 'index.html', {
            'gallery': gallery,
            'gallery_photos': gallery_photos,
            'oneofeach': oneofeach(),
            'last_articles': last_articles(20),
            'edito': edito,
            'slider': slider,
        })
Esempio n. 3
0
def sidebar_box(request):
    linked = SocialNetwork.objects.get(name='linkedin')
    viadeo = SocialNetwork.objects.get(name="viadeo")
    google = SocialNetwork.objects.get(name="google")
    today = datetime.date.today()
    edito = Edito.objects.order_by('-created_at')[0]
    stop_day = prev_month(today, 3)
    archives = convert_to_list_month(stop_day, today)
    articles = last_articles(length=4)
    categories = Category.actifs.all()
    q = request.GET.get('q', '')
    form = SearchForm({'q': q})
    return {
    'linked':linked,
    'viadeo': viadeo,
    'google': google,
    'edito': edito,
    'archives': archives,
    'form': form,
    'last_articles': articles,
    'categories': categories,
    }
Esempio n. 4
0
def sidebar_box(request):
    linked = SocialNetwork.objects.get(name='linkedin')
    viadeo = SocialNetwork.objects.get(name="viadeo")
    google = SocialNetwork.objects.get(name="google")
    today = datetime.date.today()
    edito = Edito.objects.order_by('-created_at')[0]
    stop_day = prev_month(today, 3)
    archives = convert_to_list_month(stop_day, today)
    articles = last_articles(length=4)
    categories = Category.actifs.all()
    q = request.GET.get('q', '')
    form = SearchForm({'q': q})
    return {
        'linked': linked,
        'viadeo': viadeo,
        'google': google,
        'edito': edito,
        'archives': archives,
        'form': form,
        'last_articles': articles,
        'categories': categories,
    }