brianweber2 / atr-target-trading-bot

ATR Target Trading Bot using Joe's studies.
2 stars 0 forks source link

Need User model #8

Closed brianweber2 closed 6 years ago

brianweber2 commented 6 years ago

Define User model to store a user's information in the database.

brianweber2 commented 6 years ago

The user model is defined as follows in order to work with flask-login:

class User():

  def __init__(self, first_name, last_name, username, email,
               created_at, account_ids, password=''):
    self.first_name = first_name
    self.last_name = last_name
    self.username = username
    self.email = email
    self.created_at = created_at
    self.account_ids = account_ids
    self.password = password

  def is_authenticated(self):
    return True

  def is_active(self):
    return True

  def is_anonymous(self):
    return True

  def get_id(self):
    return self.username