コード例 #1
0
 def mutate(root, info, filename, projectid, file=None):
     if file is not None:
         f = file.read()
     else:
         f = None
     s, m = pg.executequery(
         'insert into projectfiles (filename,file,projectid) values(%s,%s,%s)',
         [filename, f, projectid])
     return editNote(status=s, msg=m)
コード例 #2
0
 def mutate(root,
            info,
            username,
            noteid,
            title,
            description=None,
            color=None):
     s, m = pg.executequery(
         'update note set title = %s description = %s color = %s createdby = %s where noteid = %s);',
         [title, description, color, username, noteid])
     return editNote(status=s, msg=m)
コード例 #3
0
    def mutate(root,
               info,
               username,
               title,
               projectid=None,
               description=None,
               color=None):
        if not projectid:
            s, m = pg.executequery(
                'insert into note (title,description,color,boardid,createdby) values (%s,%s,%s,(select boardid from board where username = %s),%s);',
                [title, description, color, username, username])

        else:
            s, m = pg.executequery('call add_note (%s, %s,%s,%s,%s)', [
                username,
                projectid,
                title,
                description,
                color,
            ])

        return addNote(status=s, msg=m)
コード例 #4
0
 def mutate(root,
            info,
            username,
            name,
            longdescription=None,
            shortdescription=None,
            path=None,
            members=None):
     usernames = [x.username
                  for x in members] if members is not None else None
     roles = [x.role for x in members] if members is not None else None
     m = [[x, y] for x, y in zip(usernames, roles)
          ] if usernames is not None and roles is not None else None
     s, m = pg.executequery(
         "call create_project(%s,%s,%s,%s,%s,%s);",
         [username, name, longdescription, shortdescription, path, m])
     return createProject(status=s, msg=m)
コード例 #5
0
 def mutate(root,
            info,
            assignedby,
            assignedto,
            projectid,
            title,
            description=None,
            startdate=None,
            enddate=None,
            priority=None,
            preqtaskid=None):
     if not priority:
         priority = 'normal'
     s, m = pg.executequery("call add_task (%s,%s,%s,%s,%s,%s,%s,%s,%s);", [
         assignedby, assignedto, projectid, title, description, startdate,
         enddate, priority, preqtaskid
     ])
     return addTask(status=s, msg=m)
コード例 #6
0
 def mutate(
     root,
     info,
     username,
     taskid,
     title,
     assignedto,
     preqtaskid=None,
     description=None,
     startdate=None,
     enddate=None,
     priority=None,
 ):
     s, m = pg.executequery(
         'call edit_task (%s,%s,%s,%s,%s,%s,%s,%s,%s::integer[]);', [
             username, taskid, assignedto, title, description, startdate,
             enddate, priority, preqtaskid
         ])
     return updateTask(status=s, msg=m)
コード例 #7
0
 def mutate(root, info, username):
     s, m = pg.executequery("DELETE FROM users where username = %s",
                            [username])
     return deleteUser(status=s, msg=m)
コード例 #8
0
 def mutate(root, info, username, newfirstname, newlastname):
     s, m = pg.executequery(
         "UPDATE users SET firstname=%s, lastname=%s where username = %s",
         [newfirstname, newlastname, username])
     return changeName(status=s, msg=m)
コード例 #9
0
 def mutate(root, info, username, oldpassword, newpassword):
     s, m = pg.executequery("CALL change_password(%s,%s,%s);",
                            [username, oldpassword, newpassword])
     return changePassword(status=s, msg=m)
コード例 #10
0
 def mutate(root, info, username, noteid):
     s, m = pg.executequery('delete from note where noteid = %s;', [noteid])
     return deleteNote(status=s, msg=m)
コード例 #11
0
 def mutate(root, info, username, taskid):
     s, m = pg.executequery('call complete_task (%s,%s);',
                            [taskid, username])
     return completeTask(status=s, msg=m)
コード例 #12
0
 def mutate(root, info, username, member, projectid, role=None):
     s, m = pg.executequery("call add_member(%s,%s,%s,%s);",
                            [username, member, projectid, role])
     return addMember(status=s, msg=m)
コード例 #13
0
 def mutate(root, info, username, firstname, lastname, password, emailid):
     s, m = pg.executequery(
         "INSERT INTO users VALUES (%s,%s,%s,%s,%s,%s);",
         [username, firstname, lastname, password, emailid, None])
     return createUser(status=s, msg=m)
コード例 #14
0
 def mutate(root, info, username, member, projectid):
     s, m = pg.executequery("call delete_member (%s,%s,%s);",
                            [username, member, projectid])
     return deleteMember(status=s, msg=m)
コード例 #15
0
 def mutate(root, info, username, projectid):
     s, m = pg.executequery("CALL delete_project(%s,%s);",
                            [username, projectid])
     return deleteProject(status=s, msg=m)