def get_factory_by_code(code): # Prepare SQL query to get user location. sql = ("SELECT id FROM factory WHERE code = '%s'") results = du.execute(sql % code) return results
def get_vendor_by_code(code): sql = ("SELECT id FROM vendor WHERE code = '%s'") results = du.execute(sql % code) return results