# Path: storylist/models.py
# class Story(models.Model):
#     headline = models.CharField(max_length=100)
#     url = models.CharField(max_length=250)
#     source = models.CharField(max_length=50)
#     added = models.DateTimeField()
# 
#     def __unicode__(self):
#     	return u'%s: %s' % (self.source, self.headline)
# 
# Path: storylist/models.py
# class Story(models.Model):
#     headline = models.CharField(max_length=100)
#     url = models.CharField(max_length=250)
#     source = models.CharField(max_length=50)
#     added = models.DateTimeField()
# 
#     def __unicode__(self):
#     	return u'%s: %s' % (self.source, self.headline)


from django.shortcuts import render
from storylist.models import Story
from django.shortcuts import render_to_response
from datetime import datetime, timedelta
from django.http import HttpResponse
from storylist.models import Story
from django.template import Context

def index(request):
	"""
	Main Index View:
	Displays all stories crawled in the past 24 hours
	"""
	past24 = datetime.now() - timedelta(days=1)

# Path: storylist/models.py
# class Story(models.Model):
#     headline = models.CharField(max_length=100)
#     url = models.CharField(max_length=250)
#     source = models.CharField(max_length=50)
#     added = models.DateTimeField()
# 
#     def __unicode__(self):
#     	return u'%s: %s' % (self.source, self.headline)
# 
# Path: storylist/models.py
# class Story(models.Model):
#     headline = models.CharField(max_length=100)
#     url = models.CharField(max_length=250)
#     source = models.CharField(max_length=50)
#     added = models.DateTimeField()
# 
#     def __unicode__(self):
#     	return u'%s: %s' % (self.source, self.headline)


# Path: storylist/views.py
from django.shortcuts import render
from storylist.models import Story
from django.shortcuts import render_to_response
from datetime import datetime, timedelta
from django.http import HttpResponse
from storylist.models import Story
from django.template import Context


def index(request):
	"""
	Main Index View:
	Displays all stories crawled in the past 24 hours
	"""
	past24 = datetime.now() - timedelta(days=1)

	stories = Story.objects.filter(added__gt=past24).all()