code: def get_columns(model=None, fields=None, meta=None):
      
      if model:
          M = get_model(model)
      else:
          M = None
      if fields is not None:
          f = fields
  
      if M:
          if meta and hasattr(M, meta):
              m = getattr(model, meta)
              if hasattr(m, 'fields'):
                  f = m.fields
              else:
                  f = M._fields_list
          else:
              f = M._fields_list
  
      columns = []
      for x in f:
          if isinstance(x, str):  # so x is field_name
              field_name = x
          elif isinstance(x, dict):
              field_name = x['name']
          else:
              raise UliwebError("Field definition is not right, it should be just like str or {'name':xxx}")
  
          if '.' in field_name:
              model_name, field_name = field_name.split('.')
              M = get_model(model_name)
  
          if not M:
              raise UliwebError("Model can't be empty, because field name not has `model.` prefix")
  
          if field_name in M.c:
              columns.append(M.c[field_name])
  
      return columns
docs: Get model columns list