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