Skip to content

Instantly share code, notes, and snippets.

@hgezim
Created October 29, 2013 13:00
Show Gist options
  • Save hgezim/7214178 to your computer and use it in GitHub Desktop.
Save hgezim/7214178 to your computer and use it in GitHub Desktop.
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