Exemplo n.º 1
0
 def ensure_cursor_death(self, collection, cursor_id, retrieved):
     batch_size = self.real_app.config['CURSOR_BATCH_SIZE']
     cursor = Cursor(collection, _cursor_id=cursor_id,
                     limit=batch_size, _retrieved=retrieved)
     try:
         cursor.next()
     except StopIteration:
         pass
     except OperationFailure:
         pass
     else:
         self.fail('Cursor was not killed')
Exemplo n.º 2
0
 def next(self):
     """A `next` that caches the returned results.  Together with the
     slightly different `__iter__`, these cursors can be iterated over
     more than once."""
     if self.__tailable:
         return PymongoCursor.next(self)
     try:
         ret = PymongoCursor.next(self)
     except StopIteration:
         self.__fullcache = True
         raise
     self.__itercache.append(ret)
     return ret
 def ensure_cursor_death(self, collection, cursor_id, retrieved):
     batch_size = self.real_app.config['CURSOR_BATCH_SIZE']
     cursor = Cursor(collection,
                     _cursor_id=cursor_id,
                     limit=batch_size,
                     _retrieved=retrieved)
     try:
         cursor.next()
     except StopIteration:
         pass
     except OperationFailure:
         pass
     else:
         self.fail('Cursor was not killed')
Exemplo n.º 4
0
 def next(self):
     value = PyCursor.next(self)
     return self._model(**value)
Exemplo n.º 5
0
 def next(self, *args, **kwargs):
     result = Cursor.next(self, *args, **kwargs)
     if not result is None:
         return CSObject(getattr(winter.objects, self.collection.name)(result),
                 self.collection.name)
     return result
Exemplo n.º 6
0
 def next(self):
     return self._document(PymongoCursor.next(self), **self._kwargs)
Exemplo n.º 7
0
 def next(self):
     value = PyCursor.next(self)
     return self._model(**value)
Exemplo n.º 8
0
 def next(self):
     return self._document(PymongoCursor.next(self), **self._kwargs)