# Path: fbone/utils.py
# def get_current_time():
#     return datetime.utcnow()
# 
# STRING_LEN = 64


from sqlalchemy import Column
from werkzeug import generate_password_hash, check_password_hash
from flask.ext.login import UserMixin
from ..extensions import db
from ..utils import get_current_time, STRING_LEN
from .constants import USER, USER_ROLE, ADMIN, INACTIVE, USER_STATUS
# -*- coding: utf-8 -*-




class User(db.Model, UserMixin):

    __tablename__ = 'users'

    id = Column(db.Integer, primary_key=True)
    name = Column(db.String(STRING_LEN), nullable=False, unique=True)
    email = Column(db.String(STRING_LEN), nullable=False, unique=True)
    openid = Column(db.String(STRING_LEN), unique=True)
    activation_key = Column(db.String(STRING_LEN))

# Path: fbone/utils.py
# def get_current_time():
#     return datetime.utcnow()
# 
# STRING_LEN = 64


# Path: fbone/user/models.py
from sqlalchemy import Column
from werkzeug import generate_password_hash, check_password_hash
from flask.ext.login import UserMixin
from ..extensions import db
from ..utils import get_current_time, STRING_LEN
from .constants import USER, USER_ROLE, ADMIN, INACTIVE, USER_STATUS

# -*- coding: utf-8 -*-




class User(db.Model, UserMixin):

    __tablename__ = 'users'

    id = Column(db.Integer, primary_key=True)
    name = Column(db.String(STRING_LEN), nullable=False, unique=True)
    email = Column(db.String(STRING_LEN), nullable=False, unique=True)
    openid = Column(db.String(STRING_LEN), unique=True)
    activation_key = Column(db.String(STRING_LEN))

    created_time = Column(db.DateTime, default=get_current_time)