-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathuser_model.py
More file actions
27 lines (21 loc) · 803 Bytes
/
user_model.py
File metadata and controls
27 lines (21 loc) · 803 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sun Jul 15 12:51:43 2018
@author: rohanbagwe
"""
import sys
sys.path.append('/home/rohanbagwe/Google/Flask+SQLAlchemy/User_login/')
from base import Base
from sqlalchemy import Column, Integer, String, Sequence, UniqueConstraint
class User(Base):
__tablename__ = 'users'
__table_args__ = {'extend_existing': True}
id = Column(Integer, Sequence('user_id_seq'), primary_key=True)
username = Column(String(50))
fullname = Column(String(50))
password = Column(String(12))
UniqueConstraint(username, name="username unique index")
def __repr__(self):
return "<User(username='%s', fullname='%s', password='%s')>" % (
self.username, self.fullname, self.password)