import sys
reload(sys)
sys.setdefaultencoding( "utf-8" )

from django.db import models
from django.contrib.auth.models import User


# Create your models here.
class Category(models.Model):
    name = models.CharField(max_length = 32,unique = True)
    administrator =models.ForeignKey('BBS_user')
    def __unicode__(self):
        return self.name

class BBS(models.Model):
    category = models.ForeignKey('Category')
    title = models.CharField(max_length=64)
    summary = models.CharField(max_length=256,blank=True,null=True)
    content = models.TextField()
    author = models.ForeignKey('BBS_user')
    view_count = models.IntegerField()
    ranking = models.IntegerField()
    created_time = models.DateTimeField()    
    updated_time = models.DateTimeField()
    
    def __unicode__(self):
        return self.title
        

       
class BBS_user(models.Model):
    user = models.OneToOneField(User)
    signature = models.CharField(max_length=128,default ='too lazy ,nothing here')
    photo = models.ImageField(upload_to = 'upload_imgs/',default="upload_imgs/user-1.jpg")
    
    def __unicode__(self):
        return self.user.username
    
0d85af2b17260ff268152104dbd7ea84c63cbdf3
<mask token>


class BBS(models.Model):
    category = models.ForeignKey('Category')
    title = models.CharField(max_length=64)
    summary = models.CharField(max_length=256, blank=True, null=True)
    content = models.TextField()
    author = models.ForeignKey('BBS_user')
    view_count = models.IntegerField()
    ranking = models.IntegerField()
    created_time = models.DateTimeField()
    updated_time = models.DateTimeField()

    def __unicode__(self):
        return self.title


class BBS_user(models.Model):
    user = models.OneToOneField(User)
    signature = models.CharField(max_length=128, default=
        'too lazy ,nothing here')
    photo = models.ImageField(upload_to='upload_imgs/', default=
        'upload_imgs/user-1.jpg')

    def __unicode__(self):
        return self.user.username

<mask token>


class Category(models.Model):
    <mask token>
    <mask token>
    <mask token>


class BBS(models.Model):
    category = models.ForeignKey('Category')
    title = models.CharField(max_length=64)
    summary = models.CharField(max_length=256, blank=True, null=True)
    content = models.TextField()
    author = models.ForeignKey('BBS_user')
    view_count = models.IntegerField()
    ranking = models.IntegerField()
    created_time = models.DateTimeField()
    updated_time = models.DateTimeField()

    def __unicode__(self):
        return self.title


class BBS_user(models.Model):
    user = models.OneToOneField(User)
    signature = models.CharField(max_length=128, default=
        'too lazy ,nothing here')
    photo = models.ImageField(upload_to='upload_imgs/', default=
        'upload_imgs/user-1.jpg')

    def __unicode__(self):
        return self.user.username

<mask token>


class Category(models.Model):
    name = models.CharField(max_length=32, unique=True)
    administrator = models.ForeignKey('BBS_user')

    def __unicode__(self):
        return self.name


class BBS(models.Model):
    category = models.ForeignKey('Category')
    title = models.CharField(max_length=64)
    summary = models.CharField(max_length=256, blank=True, null=True)
    content = models.TextField()
    author = models.ForeignKey('BBS_user')
    view_count = models.IntegerField()
    ranking = models.IntegerField()
    created_time = models.DateTimeField()
    updated_time = models.DateTimeField()

    def __unicode__(self):
        return self.title


class BBS_user(models.Model):
    user = models.OneToOneField(User)
    signature = models.CharField(max_length=128, default=
        'too lazy ,nothing here')
    photo = models.ImageField(upload_to='upload_imgs/', default=
        'upload_imgs/user-1.jpg')

    def __unicode__(self):
        return self.user.username

<mask token>
reload(sys)
sys.setdefaultencoding('utf-8')
<mask token>


class Category(models.Model):
    name = models.CharField(max_length=32, unique=True)
    administrator = models.ForeignKey('BBS_user')

    def __unicode__(self):
        return self.name


class BBS(models.Model):
    category = models.ForeignKey('Category')
    title = models.CharField(max_length=64)
    summary = models.CharField(max_length=256, blank=True, null=True)
    content = models.TextField()
    author = models.ForeignKey('BBS_user')
    view_count = models.IntegerField()
    ranking = models.IntegerField()
    created_time = models.DateTimeField()
    updated_time = models.DateTimeField()

    def __unicode__(self):
        return self.title


class BBS_user(models.Model):
    user = models.OneToOneField(User)
    signature = models.CharField(max_length=128, default=
        'too lazy ,nothing here')
    photo = models.ImageField(upload_to='upload_imgs/', default=
        'upload_imgs/user-1.jpg')

    def __unicode__(self):
        return self.user.username

import sys
reload(sys)
sys.setdefaultencoding( "utf-8" )

from django.db import models
from django.contrib.auth.models import User


# Create your models here.
class Category(models.Model):
    name = models.CharField(max_length = 32,unique = True)
    administrator =models.ForeignKey('BBS_user')
    def __unicode__(self):
        return self.name

class BBS(models.Model):
    category = models.ForeignKey('Category')
    title = models.CharField(max_length=64)
    summary = models.CharField(max_length=256,blank=True,null=True)
    content = models.TextField()
    author = models.ForeignKey('BBS_user')
    view_count = models.IntegerField()
    ranking = models.IntegerField()
    created_time = models.DateTimeField()    
    updated_time = models.DateTimeField()
    
    def __unicode__(self):
        return self.title
        

       
class BBS_user(models.Model):
    user = models.OneToOneField(User)
    signature = models.CharField(max_length=128,default ='too lazy ,nothing here')
    photo = models.ImageField(upload_to = 'upload_imgs/',default="upload_imgs/user-1.jpg")
    
    def __unicode__(self):
        return self.user.username
    