code: def search(self, rtype, **kwargs):
          model = rtype_to_model(rtype)
          param = {}
          pages = self.pages_query(kwargs.get('pages'))
          sorts = self.sorts_query(kwargs.get(
              'sorts', [Sortable(goldman.config.SORT)]
          ))
          query =
          query = query.format(
              cols=self.field_cols(model),
              table=rtype,
          )
          filters = kwargs.get('filters', [])
          filters += getattr(model, 'search_filters', []) or []
          if filters:
              where, param = self.filters_query(filters)
              query += where
          model_query = getattr(model, 'search_query', '') or ''
          if filters and model_query:
              model_query = ' AND ' + model_query
          elif model_query:
              model_query = ' WHERE ' + model_query
          query += model_query
          query += sorts
          query += pages
          signals.pre_search.send(model.__class__, model=model)
          result = self.query(query, param=param)
          models = [model(res) for res in result]
          if models:
              signals.post_search.send(model.__class__, models=result)
          pages = kwargs.get('pages')
          if pages and result:
              pages.total = result[0]['_count']
          return models