(props)
return sqlstr[:-4]
生成查询条件字符串
生成查询条件字符串
生成查询条件字符串
def FormatCondition(props):
    """生成查询条件字符串
    """
    items = props.items()
    itemstrlist = []
    for _item in items:
        if isinstance(_item[1],Number):
            sqlstr = " `%s`=%s AND"%_item
        else:
            sqlstr = " `%s`='%s' AND "%(_item[0],str(_item[1]).replace("'", "\\'"))
        itemstrlist.append(sqlstr)
    sqlstr = ''.join(itemstrlist)
    return sqlstr[:-4]
def FormatCondition ( props ) : items = props . items ( ) itemstrlist = [ ] for _item in items : if isinstance ( _item [ 1 ] , Number ) : sqlstr = " `%s`=%s AND" % _item else : sqlstr = " `%s`='%s' AND " % ( _item [ 0 ] , str ( _item [ 1 ] ) . replace ( "'" , "\\'" ) ) itemstrlist . append ( sqlstr ) sqlstr = '' . join ( itemstrlist ) return sqlstr [ : - 4 ]