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')
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')
def next(self): value = PyCursor.next(self) return self._model(**value)
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
def next(self): return self._document(PymongoCursor.next(self), **self._kwargs)
def next(self): value = PyCursor.next(self) return self._model(**value)
def next(self): return self._document(PymongoCursor.next(self), **self._kwargs)