code: def _previous(self, **kwargs):
          
          spec = self._pagination_default_spec(kwargs)
          spec.update(kwargs)
  
          query = queries.build_query(spec)
          query = queries.where_before_entry(query, self._record)
  
          for record in query.order_by(orm.desc(model.Entry.local_date),
                                       orm.desc(model.Entry.id))[:1]:
              return Entry(record)
          return None
docs: Get the previous item in any particular category