예제 #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)