Advertisement
pegorino

add

Jan 28th, 2018
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.31 KB | None | 0 0
  1.     def add_contact(self, owner, contact):
  2.         session = self._session_class()
  3.         new_contact = Contact(owner_id=owner.client_id, contact_id=contact.client_id)
  4.         try:
  5.             session.add(new_contact)
  6.             session.commit()
  7.         except:
  8.             print('failed to add contact')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement