示例#1
0
文件: models.py 项目: daamien/kansha
 def change_role(self, board_member, new_role):
     obj = DataBoardManager.get_by(board=self, member=board_member.get_user_data())
     if new_role == 'manager':
         if obj is None:
             obj = DataBoardManager(board=self, member=board_member.get_user_data())
             session.add(obj)
     else:
         if obj is not None:
             obj.delete()
示例#2
0
 def change_role(self, board_member, new_role):
     obj = DataBoardManager.get_by(board=self, member=board_member.get_user_data())
     if new_role == 'manager':
         if obj is None:
             obj = DataBoardManager(board=self, member=board_member.get_user_data())
             session.add(obj)
     else:
         if obj is not None:
             obj.delete()
示例#3
0
 def remove_manager(self, board_member):
     obj = DataBoardManager.get_by(board=self,
                                   member=board_member.get_user_data())
     if obj is not None:
         obj.delete()
     self.remove_member(board_member)
示例#4
0
文件: models.py 项目: daamien/kansha
 def remove_manager(self, board_member):
     obj = DataBoardManager.get_by(board=self, member=board_member.get_user_data())
     if obj is not None:
         obj.delete()
     self.remove_member(board_member)