Skip to content

Instantly share code, notes, and snippets.

@hgezim hgezim/models.py
Created Oct 29, 2013

Embed
What would you like to do?
class Post(models.Model):
title = models.CharField(max_length=500)
hn_id = models.CharField(max_length=50, unique=True)
points = models.IntegerField(null=True)
comment_count = models.IntegerField()
comments_link = models.URLField()
date = models.DateTimeField() # datetime that HN post was posted
date_scraped = models.DateTimeField(auto_now_add = True) # date object was scraped from HN
date_modified = models.DateTimeField(auto_now = True) # date this object has been updated (rescraped)
# link the story is linked to -- HN links can be long so set max_length to 2000
link = models.URLField(max_length=2000)
posted_by = models.CharField(max_length=100, null=True)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.