# CCS CS Lab Wall Views # # Douglas Thrift # # $Id$ from ccscslab.wall.jsons import LCDJSONEncoder from ccscslab.wall.models import Post from datetime import datetime, timedelta from django.db.models.query import QuerySet from django.http import HttpResponse from dt_django_http_login import http_login_required try: import simplejson as json except ImportError: import json @http_login_required(login_realm = 'Wall LCD') def lcd(request): return HttpResponse(json.dumps(Post.objects.filter(posted__gt = datetime.utcnow() - timedelta(days = 1)), cls = LCDJSONEncoder), content_type = 'application/json')