class User(db.Model): __tablename__ = 'users' id = db.Column(db.Integer(), primary_key=True) password = db.Column(db.String()) email = db.Column(db.String(128), nullable=False, unique=True) first_name = db.Column(db.Unicode(30)) last_name = db.Column(db.Unicode(30)) facebook_id = db.Column(db.Unicode(256)) def password_match(self, input_password): return pbkdf2_sha256.verify(input_password, self.password)
class User(db.Model): __tablename__ = 'users' id = db.Column(db.Integer(), primary_key=True) username = db.Column(db.Unicode()) password = db.Column(db.String()) email = db.Column(db.String(128), unique=True)
class Message(db.Model): __tablename__ = 'chat_messages' id = db.Column(db.Integer(), primary_key=True) text = db.Column(db.Unicode()) created_date = db.Column(db.DateTime()) room_id = db.Column(db.Integer(), db.ForeignKey('chat_rooms.id')) user_name = db.Column(db.String(), db.ForeignKey('users.username'))
class Room(db.Model): __tablename__ = 'chat_rooms' id = db.Column(db.Integer(), primary_key=True) name = db.Column(db.Unicode(30)) created_date = db.Column(db.DateTime())
class User(BaseModelMixin, db.Model): id = db.Column(db.Integer(), primary_key=True) username = db.Column(db.Unicode(), default="noname")
class User(BaseDBModel): """Модель для управления пользователями.""" name = db.Column(db.Unicode())