Guest User

Untitled

a guest
Jul 16th, 2018
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. class User(db.Model):
  2. #__tablename__ = 'user1'
  3. id = Column(Integer, primary_key=True)
  4. nickname = Column(String(24), nullable=False)
  5. _password = Column('password', String(64)) # 重新定义字段为password
  6. phone_number = Column(String(18), unique=True)
  7. email = Column(String(50), unique=True, nullable=False)
  8. confirmed = Column(Boolean, default=False)
  9. beans = Column(Float, default=0)
  10. send_counter = Column(Integer, default=0)
  11. receive_counter = Column(Integer, default=0)
  12. wx_open_id = Column(String(50))
  13. wx_name = Column(String(32))
  14.  
  15. @property
  16. def password(self):
  17. pass
  18.  
  19. @password.setter
  20. def password(self, raw):
  21. self._password = generate_password_hash(raw)
Add Comment
Please, Sign In to add comment