Advertisement
juacywillian

kivy login example

Nov 30th, 2017
171
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.51 KB | None | 0 0
  1. def login(username, password):
  2.     user = select(user).where(user.username == username, user.password == password).first()
  3.     if user:
  4.         return user.id
  5.     else None
  6.  
  7.  
  8. class TelaLogin():
  9.     def click_select(self, bt):
  10.         username = self.ids.ed1.text
  11.         password = self.ids.ed2.text
  12.  
  13.         try:
  14.             if not(username == '' or password == ''):
  15.                 user = login(username, password)
  16.                 if user:
  17.                     sm.switch_to(TelaPrincipal(name='Principal'))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement