code: def tupleize(
      rows,
      alphabetize_columns=getattr(
          settings,
          'ALPHABETIZE_COLUMNS',
          False)):
      
  
      # define a blank list as our return object
      l = []
      for r in rows:
          row = []
          row = list(r.values())
          l.append(row)
  
      # alphabetize
      if alphabetize_columns:
          col = sorted(zip(*l))
          result = zip(*col)
          return result
      else:
          return l
docs: Also alphabetizes columns and returns a tuple of tuples