Advertisement
Guest User

Untitled

a guest
Nov 12th, 2018
286
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.56 KB | None | 0 0
  1. class User(object):
  2.     def __init__(self, id, login, email, password, password2):
  3.         self.id = id
  4.         self.login = login
  5.         self.email = email
  6.         self.password = password
  7.         self.password2 = password2
  8.  
  9.     @classmethod
  10.     def create_user_from_dict(cls, user_object):
  11.         user = User(
  12.             id=user_object['id'],
  13.             login=user_object['login'],
  14.             email=user_object['email'],
  15.             password=user_object['password'],
  16.             password2=user_object['password2'],
  17.         )
  18.  
  19.         return user
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement