Commit 688a5beac835a26efe7c06efe6b9127f83adeb03

Add method to get user by username

  Add a static method to instantiate a user object from a given username
  • Diff rendering mode:
  • inline
  • side by side

user.py

49 return user49 return user
50 return None50 return None
5151
52 @staticmethod
53 def getByName(username):
54 return User.query.filter_by(username=username).first()
55
52 def to_dict(self):56 def to_dict(self):
53 return {57 return {
54 'id': self.id,58 'id': self.id,