Пример #1
0
 def ensureProjectManager(cls, uid, pid):
     part = cls.getParticipation(uid, pid)
     part_roles = part.participationrole_set.all()
     ViewManager.ensureObjectExist(ParticipationRole,
                                   ErrorType.NotAProjManager,
                                   part_roles,
                                   role_id=Role.ProjectManagerId)
Пример #2
0
 def ensureNoticeExist(cls, **args):
     return ViewManager.ensureObjectExist(Notice,
                                          ErrorType.NoticeNotExist,
                                          **args)
Пример #3
0
 def ensureParticipationExist(cls, uid, pid):
     return ViewManager.ensureObjectExist(Participation,
                                          ErrorType.DoNotParticipated,
                                          user_id=uid,
                                          project_id=pid)
Пример #4
0
 def ensureProjectExist(cls, **args):
     return ViewManager.ensureObjectExist(Project,
                                          ErrorType.ProjectNotExist,
                                          **args)
Пример #5
0
 def ensureRoleExist(cls, rid):
     return ViewManager.ensureObjectExist(Role,
                                          ErrorType.RoleNotExist,
                                          id=rid)
Пример #6
0
 def ensureTaskProgressExist(cls, **args):
     return ViewManager.ensureObjectExist(TaskProgress,
                                          ErrorType.ProgressReqNotExist,
                                          **args)
Пример #7
0
 def ensureTaskTakeExist(cls, tid, uid):
     return ViewManager.ensureObjectExist(TaskTake,
                                          ErrorType.TaskTakeNotExist,
                                          task_id=tid,
                                          user_id=uid)
Пример #8
0
 def ensureTaskExist(cls, **args):
     return ViewManager.ensureObjectExist(Task, ErrorType.TaskNotExist,
                                          **args)
Пример #9
0
 def ensureFriendExist(cls, **args):
     return ViewManager.ensureObjectExist(Friend, ErrorType.NotAFriend,
                                          **args)
Пример #10
0
 def ensureUserExist(cls, **args):
     return ViewManager.ensureObjectExist(User, ErrorType.UsernameExist,
                                          **args)