Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
from django.db import models
class PhpbbUser(models.Model):
"""Model for phpBB user."""
user_id = models.IntegerField(primary_key=True)
user_active = models.BooleanField()
username = models.CharField(max_length=25)
user_password = models.CharField(max_length=32)
user_posts = models.IntegerField()
user_email = models.CharField(max_length=255)
user_website = models.CharField(max_length=100)
user_avatar_type = models.IntegerField()
user_avatar = models.CharField(max_length=250)
user_regdate_int = models.IntegerField(db_column="user_regdate")
user_lastvisit_int = models.IntegerField(db_column="user_lastvisit")
#user_sig_bbcode_uid = models.CharField(max_length=8)
#user_sig_bbcode_bitfield = models.CharField(max_length=255)
def __unicode__(self):
return self.username
def user_regdate(self):
return datetime.fromtimestamp(self.user_regdate_int)
def user_lastvisit(self):
return datetime.fromtimestamp(self.user_lastvisit_int)
class Meta:
db_table = 'phpbb_users'
ordering = ['username']
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment