Skip to content

Commit

Permalink
Deleted Token model and some of User model to minimize the PR
Browse files Browse the repository at this point in the history
  • Loading branch information
ahinoamta committed May 13, 2020
1 parent 02fa0d2 commit 1c34a90
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 26 deletions.
1 change: 0 additions & 1 deletion edison/models/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
from .token import Token
from .user import User
12 changes: 0 additions & 12 deletions edison/models/token.py

This file was deleted.

14 changes: 1 addition & 13 deletions edison/models/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,11 @@

class User(db.Model):
__tablename__ = 'users'
__table_args__ = {'extend_existing': True}

id = db.Column(db.Integer, primary_key=True)
username = db.Column(db.String(50), nullable=False, unique=True)
password = db.Column(db.String(150), nullable=False)
first_name = db.Column(db.String(50), nullable=False)
last_name = db.Column(db.String(50), nullable=False)
email = db.Column(db.String(150), nullable=False)

def to_json(self):
return {
"username": self.username,
"first_name": self.first_name,
"last_name": self.last_name,
"email": self.email
"username": self.username
}

def __repr__(self):
return f"<User: id = {self.id}, first_name = {self.first_name}, " \
f"last_name = {self.last_name}, username = {self.username}, email = {self.email}>"

0 comments on commit 1c34a90

Please sign in to comment.