kavanland
clone your own copy | download snapshot

Snapshots | iceberg

No images in this repository’s iceberg at this time

Inside this repository

views.py
text/x-python

Download raw (791 bytes)

from django.shortcuts import render
from twitblr.models import Tumblr, Twitter


def home(request):
    """
    Homepage: Archives latest Tumblr and Twitter posts tagged "Anna Kavan".
    """
    context = {}

    latest_tumblr = Tumblr.objects.all()[0]
    context["tumblr"] = latest_tumblr

    latest_twitter = Twitter.objects.all()[0]
    context["twitter"] = latest_twitter

    return render(request, 'aacore/home.html', context)


def twitblr(request):
    """
    Archives latest Tumblr and Twitter posts tagged "Anna Kavan".
    """
    context = {}

    tumblr_posts = Tumblr.objects.all()
    context["tumblr_posts"] = tumblr_posts

    twitter_posts = Twitter.objects.all()
    context["twitter_posts"] = twitter_posts

    return render(request, 'aacore/twitblr.html', context)