def addRoomAndAddressBook(room_uuid, focused_user_id, be_focused_user_id): roomData = { 'room_uuid': room_uuid, 'last_msg': '', 'user_id': focused_user_id, 'type': 0 } Room.insertRoomData(roomData) addressBook = AddressBook( focused_user_id=focused_user_id, be_focused_user_id=be_focused_user_id, room_uuid=room_uuid, unread_number=0, is_alert=1, type=0, ) dBSession.add(addressBook) addressBook = AddressBook( focused_user_id=be_focused_user_id, be_focused_user_id=focused_user_id, room_uuid=room_uuid, unread_number=0, is_alert=1, type=0, ) dBSession.add(addressBook) return True
def addRoomAndAddressBook(room_uuid, focused_user_id, be_focused_user_id): roomData = { 'room_uuid': room_uuid, 'last_msg': '', 'user_id': focused_user_id } room = Room.insertRoomData(roomData) addressBook = AddressBook( focused_user_id=focused_user_id, be_focused_user_id=be_focused_user_id, room_uuid=room_uuid, unread_number=0, is_alert=1, created_at=time.time(), updated_at=time.time() ) dBSession.add(addressBook) addressBook = AddressBook( focused_user_id=be_focused_user_id, be_focused_user_id=focused_user_id, room_uuid=room_uuid, unread_number=0, is_alert=1, created_at=time.time(), updated_at=time.time() ) dBSession.add(addressBook) return True