def inputView(vname): #check for no spaces and make sure it's not already used. #viewName = inputSanitizer(vname,'view') viewName = inputSani_dm.inputSanitizer(vname,'view') print "confirming view name is unique in the system" checkviewname=['view_name','bind_views',viewName] # Column, table, value #boolVar= dbRecordCheck(checkviewname) boolVar= dbchk_dm.dbRecordCheck(checkviewname) checkviewlist = [boolVar,viewName] # return result of uniqueness test and view name value if it's usable. if checkviewlist[0]: print "Sorry, that record appears to be in use, please provide a different value" return checkviewlist
def inputOrgId(orgid): #make sure there is not already a list set for this org and bail if the org ID is not a valid long/int if type(orgid) == type(long()): oid=str(orgid) else: print "there may be a problem with the org id provided, please debug" exit() print "confirming there is no existing black or white list for this organization" checkorgbw=['org_id','whitelist_domain',oid] # Column, table, value boolVar= dbchk_dm.dbRecordCheck(checkorgbw) checkviewlist = [boolVar,orgid] # return result of uniqueness test and view name value if it's usable. return checkviewlist