def getContestDetail(self, cid):

        whereclause = ' cid = {} '.format(cid)
        sql = getQuerySQL('contest', whereclause, ' cid ')
        rs = FetchOne(sql)

        return rs
示例#2
0
 def getPID(self, oj, prob):
     sql = getQueryDetailSQL(
         'problem', ' virtualOJ,virtualProb ',
         ' originOJ = "{}" and originProb = "{}" '.format(oj,
                                                          prob), ' pid ')
     rs = FetchOne(sql)
     return rs
示例#3
0
    def getContestStatus(self, cid):

        sql = getQueryDetailSQL(' contest ', ' cstatus ',
                                ' cid = {} '.format(cid), ' 1=1 ')
        rs = FetchOne(sql)

        return rs[0]
示例#4
0
    def getContestStatus(self, cid):

        sql = getQuerySQL('contest', ' cid = {} '.format(cid), ' cid ')

        # print(sql)
        rs = FetchOne(sql)

        return rs[10]
示例#5
0
def UpdateProblemDetail(problem, pid):
    pretreat_ProblemDetail(problem)

    sql = getQuerySQL('problemdetail', ' pid={} '.format(pid), ' did ')
    rs = FetchOne(sql)

    if rs is None:
        InsertProblemDetail(problem)
    else:
        clause = 'problemdetail.pid = %d' % pid
        sql = getUpdateSQL('problemdetail', data=problem, clause=clause)
        ExeSQL(sql)
示例#6
0
    def getUserInfo(self, username):

        if len(username) == 0:
            return None

        where = ' username = "******" '.format(username)
        sql = getQuerySQL('user', whereclause=where, ordclause=' uid ')
        rs = FetchOne(sql)

        print(rs)

        return rs
示例#7
0
def CheckContestIfTry(uid,pid,cid):
    sql = 'SELECT count(DISTINCT pid) FROM status WHERE uid = {} and pid = {} AND cid = {} ;'.format(uid,pid,cid)
    return FetchOne(sql)
示例#8
0
def CheckContestIfAccept(uid,pid,cid) :

    sql = 'SELECT count(DISTINCT pid) FROM status WHERE uid = {} and pid = {} and cid = {} and status like "%accept%";'.format(uid,pid,cid)
    return FetchOne(sql)
示例#9
0
    def getSubmitData(self, sid):

        sql = getQuerySQL('status', ' sid = {} '.format(sid), ' sid ')
        rs = FetchOne(sql)

        return rs
示例#10
0
    def CheckPasswrod(self, username, password):

        sql = checkUserSQL(username=username, password=password)
        rs = FetchOne(sql)

        return rs