code: def incr(self, field, incr_by=1):
          
          model_hash = self.to_hash()
  
          # Remove the value from the index.
          for index in field.get_indexes():
              index.remove(self)
  
          if isinstance(incr_by, int):
              new_val = model_hash.incr(field.name, incr_by)
          else:
              new_val = model_hash.incr_float(field.name, incr_by)
          setattr(self, field.name, new_val)
  
          # Re-index the new value.
          for index in field.get_indexes():
              index.save(self)
  
          return new_val
docs: Increment the value stored in the given field by the specified
          amount. Any indexes will be updated at the time ``incr()`` is
          called.
  
          :param Field field: A field instance.
          :param incr_by: An ``int`` or ``float``.
  
          Example:
  
          .. code-block:: python
  
              # Retrieve a page counter object for the given URL.
              page_count = PageCounter.get(PageCounter.url == url)
  
              # Update the hit count, persisting to the database and
              # updating secondary indexes in one go.
              page_count.incr(PageCounter.hits)