Exemplo n.º 1
0
class Account(db.Document):
    ws_cust_id = db.IntField(required=True, length=9)
    ws_acct_id = db.IntField(required=True, length=9)
    ws_acct_type = db.StringField(required=True, length=9)
    ws_acct_balance = db.IntField(required=True)
    ws_acct_crdate = db.DateField(required=True)
    ws_acct_lasttrdate = db.DateField()
Exemplo n.º 2
0
class Patient(db.Document):
    name = db.StringField(max_length=25)
    surname = db.StringField(max_length=25)
    phone_number = db.StringField(max_length=10, unique=True)
    address = db.StringField()
    clinic = db.StringField(max_length=50)
    registrationDate = db.DateField()
Exemplo n.º 3
0
class User(db.Document):
    user_id     =   db.IntField(unique=True)
    first_name  =   db.StringField(max_length=20)
    last_name   =   db.StringField(max_length=20)
    email       =   db.EmailField(max_length=30, unique=True)
    birthday    =   db.DateField()
    gender      =   db.StringField()
    address     =   db.StringField()
    suburb      =   db.StringField()
    postcode    =   db.IntField(length=4)
    description =   db.StringField(max_length = 200)
    password    =   db.StringField(max_length=20)
    available   =   db.BooleanField(default=True)
    token       =   db.StringField()
    contacts    =   db.ListField(Contact)
    # profile_pic =   
    
    def set_password(self, password):
        self.password = generate_password_hash(password)

    def get_password(self, password):
        return check_password_hash(self.password, password)   

    def assign_token(self, id):
        secret = 'YUWA'
        token = str(jwt.encode({'id': id}, secret, algorithm='HS256'))
        self.token = token
        db.Users.update(
            {"_id": id}, 
            {$set: {"token": token}}
        )
        return token

    def invalidate_token(self, token):
        self.token = ""
Exemplo n.º 4
0
class News(db.Document):
    news_id = db.IntField(unique=True)
    author_name = db.StringField()
    date = db.DateField()
    title = db.StringField()
    headline = db.StringField()
    description = db.StringField()
Exemplo n.º 5
0
class Creator(db.Document):
    fullName = db.StringField()
    creatorComics = db.StringField()
    creatorStories = db.StringField()
    creatorEvents = db.StringField()
    creatorSeries = db.StringField()
    modified = db.DateField()
Exemplo n.º 6
0
class Transaction(db.Document):
    ws_cust_id = db.IntField(required=True, length=9)
    ws_acct_id = db.IntField(required=True, length=9)
    ws_transaction_id = db.IntField(required=True, length=9)
    ws_description = db.StringField(required=True, length=9)
    ws_amount = db.IntField(required=True)
    ws_trxn_date = db.DateField(required=True)
Exemplo n.º 7
0
class Account_Status(db.Document):
    ws_cust_id = db.IntField(required=True, length=9)
    ws_acct_id = db.IntField(required=True, length=9)
    ws_acct_type = db.StringField(required=True, length=9)
    ws_acct_status = db.StringField(required=True)
    ws_message = db.StringField()
    ws_acct_lastUdate = db.DateField()
class Appointment(db.Document):
    myid        =   db.IntField( db_field='id', unique=True)
    prof_id     =   db.IntField( max_length=50 )    
    user_id     =   db.IntField( max_length=50 )
    prof_name   =   db.StringField( max_length=50 )  
    status      =   db.StringField( max_length=20 )  
    slot        =   db.StringField( max_length=30 )   
    date        =   db.DateField()
class Professorslot(db.Document):
    block_id    =   db.IntField( unique=True)
    prof_id     =   db.IntField( max_length=50 )    
    date        =   db.DateField(unique=True)
    slots       =   db.ListField()
class Holiday(db.Document):
    holiday_id  =   db.IntField( unique=True)
    date        =   db.DateField(unique=True)
Exemplo n.º 11
0
class Customer_Status(db.Document):
    ws_ssn_id = db.IntField(length=9)
    ws_cust_id = db.IntField(required=True, length=9)
    ws_status = db.StringField(max_length=30)
    ws_message = db.StringField()
    ws_cust_lastUdate = db.DateField()