code: def count(self, *criterion, **kwargs):
          
          query = self._query(*criterion)
          query = self._filter(query, **kwargs)
          return query.count()
docs: Count the number of models matching some criterion.