Added validated field to Reddit account

This commit is contained in:
2010-04-02 19:04:01 +01:00
parent 33914c7a8d
commit 795066dfaa
3 changed files with 11 additions and 3 deletions

View File

@@ -0,0 +1 @@
SEQUENCE = ['validation-field']

View File

@@ -0,0 +1,7 @@
from django_evolution.mutations import *
from django.db import models
MUTATIONS = [
AddField('RedditAccount', 'validated', models.BooleanField),
]

View File

@@ -14,11 +14,11 @@ class RedditAccount(models.Model):
username = models.CharField("Reddit Username", max_length=32, blank=False)
reddit_id = models.CharField("Reddit ID", max_length=32)
date_created = models.DateTimeField("Date Created")
link_karma = models.IntegerField("Link Karma")
comment_karma = models.IntegerField("Comment Karma")
validated = models.BooleanField("Validated")
date_created = models.DateTimeField("Date Created")
last_update = models.DateTimeField("Last Update from API")
def api_update(self):
@@ -32,8 +32,8 @@ class RedditAccount(models.Model):
self.link_karma = data['link_karma']
self.comment_karma = data['comment_karma']
self.reddit_id = data['id']
self.date_created = datetime.fromtimestamp(data['created_utc'])
self.date_created = datetime.fromtimestamp(data['created_utc'])
self.last_update = datetime.now()
class Meta: