BUMP 1.6 -- see changelog for details
This commit is contained in:
parent
b0aa2b3b17
commit
f2029b175c
@ -1,6 +1,33 @@
|
||||
Changelog
|
||||
=========
|
||||
|
||||
Changes in Version 1.6
|
||||
----------------------
|
||||
|
||||
The biggest change in version 1.6 is a complete re-implementation of
|
||||
:mod:`gridfs` with a lot of improvements over the old
|
||||
implementation. There are many details and examples of using the new
|
||||
API in `this blog post
|
||||
<http://dirolf.com/2010/03/29/new-gridfs-implementation-for-pymongo.html>`_. The
|
||||
old API has been removed in this version, so existing code will need
|
||||
to be modified before upgrading to 1.6.
|
||||
|
||||
- fixed issue where connection pool was being shared across
|
||||
:class:`~pymongo.connection.Connection` instances.
|
||||
- more improvements to Python code caching in C extension - should
|
||||
improve behavior on mod_wsgi.
|
||||
- added :meth:`~pymongo.objectid.ObjectId.from_datetime`.
|
||||
- complete rewrite of :mod:`gridfs` support.
|
||||
- improvements to the :meth:`~pymongo.database.Database.command` API.
|
||||
- fixed :meth:`~pymongo.collection.Collection.drop_indexes` behavior
|
||||
on non-existent collections.
|
||||
- disallow empty bulk inserts.
|
||||
|
||||
Changes in Version 1.5.2
|
||||
------------------------
|
||||
- fixed response handling to ignore unknown response flags in queries.
|
||||
- handle server versions containing '-pre-'.
|
||||
|
||||
Changes in Version 1.5.1
|
||||
------------------------
|
||||
- added :data:`~gridfs.grid_file.GridFile._id` property for
|
||||
|
||||
@ -1,6 +1,14 @@
|
||||
GridFS Example
|
||||
==============
|
||||
|
||||
.. warning::
|
||||
|
||||
This example is out of date, and documents the API for GridFS in
|
||||
PyMongo versions < 1.6. If you are using a version of PyMongo that
|
||||
is >= 1.6 please see `this blog post
|
||||
<http://dirolf.com/2010/03/29/new-gridfs-implementation-for-pymongo.html>`_
|
||||
for an overview of how the new API works.
|
||||
|
||||
.. testsetup::
|
||||
|
||||
from pymongo import Connection
|
||||
|
||||
@ -41,7 +41,7 @@ class GridFS(object):
|
||||
- `database`: database to use
|
||||
- `collection` (optional): root collection to use
|
||||
|
||||
.. versionadded:: 1.5.2+
|
||||
.. versionadded:: 1.6
|
||||
The `collection` parameter.
|
||||
|
||||
.. mongodoc:: gridfs
|
||||
@ -66,7 +66,7 @@ class GridFS(object):
|
||||
:Parameters:
|
||||
- `**kwargs` (optional): keyword arguments for file creation
|
||||
|
||||
.. versionadded:: 1.5.2+
|
||||
.. versionadded:: 1.6
|
||||
"""
|
||||
return GridIn(self.__collection, **kwargs)
|
||||
|
||||
@ -91,7 +91,7 @@ class GridFS(object):
|
||||
- `data`: data to be written as a file.
|
||||
- `**kwargs` (optional): keyword arguments for file creation
|
||||
|
||||
.. versionadded:: 1.5.2+
|
||||
.. versionadded:: 1.6
|
||||
"""
|
||||
grid_file = GridIn(self.__collection, **kwargs)
|
||||
try:
|
||||
@ -109,7 +109,7 @@ class GridFS(object):
|
||||
:Parameters:
|
||||
- `file_id`: ``"_id"`` of the file to get
|
||||
|
||||
.. versionadded:: 1.5.2+
|
||||
.. versionadded:: 1.6
|
||||
"""
|
||||
return GridOut(self.__collection, file_id)
|
||||
|
||||
@ -128,7 +128,7 @@ class GridFS(object):
|
||||
:Parameters:
|
||||
- `filename`: ``"filename"`` of the file to get
|
||||
|
||||
.. versionadded:: 1.5.2+
|
||||
.. versionadded:: 1.6
|
||||
"""
|
||||
self.__files.ensure_index([("filename", ASCENDING),
|
||||
("uploadDate", DESCENDING)])
|
||||
@ -156,7 +156,7 @@ class GridFS(object):
|
||||
:Parameters:
|
||||
- `file_id`: ``"_id"`` of the file to delete
|
||||
|
||||
.. versionadded:: 1.5.2+
|
||||
.. versionadded:: 1.6
|
||||
"""
|
||||
self.__files.remove({"_id": file_id}, safe=True)
|
||||
self.__chunks.remove({"files_id": file_id})
|
||||
@ -165,7 +165,7 @@ class GridFS(object):
|
||||
"""List the names of all files stored in this instance of
|
||||
:class:`GridFS`.
|
||||
|
||||
.. versionchanged:: 1.5.2+
|
||||
.. versionchanged:: 1.6
|
||||
Removed the `collection` argument.
|
||||
"""
|
||||
return self.__files.distinct("filename")
|
||||
@ -173,7 +173,7 @@ class GridFS(object):
|
||||
def open(self, *args, **kwargs):
|
||||
"""No longer supported.
|
||||
|
||||
.. versionchanged:: 1.5.2+
|
||||
.. versionchanged:: 1.6
|
||||
The open method is no longer supported.
|
||||
"""
|
||||
raise UnsupportedAPI("The open method is no longer supported.")
|
||||
@ -181,7 +181,7 @@ class GridFS(object):
|
||||
def remove(self, *args, **kwargs):
|
||||
"""No longer supported.
|
||||
|
||||
.. versionchanged:: 1.5.2+
|
||||
.. versionchanged:: 1.6
|
||||
The remove method is no longer supported.
|
||||
"""
|
||||
raise UnsupportedAPI("The remove method is no longer supported. "
|
||||
|
||||
@ -32,17 +32,17 @@ class CorruptGridFile(GridFSError):
|
||||
class NoFile(GridFSError):
|
||||
"""Raised when trying to read from a non-existent file.
|
||||
|
||||
.. versionadded:: 1.5.2+
|
||||
.. versionadded:: 1.6
|
||||
"""
|
||||
|
||||
class UnsupportedAPI(GridFSError):
|
||||
"""Raised when trying to use the old GridFS API.
|
||||
|
||||
In version 1.5.2+ of the PyMongo distribution there were backwards
|
||||
In version 1.6 of the PyMongo distribution there were backwards
|
||||
incompatible changes to the GridFS API. Upgrading shouldn't be
|
||||
difficult, but the old API is no longer supported (with no
|
||||
deprecation period). This exception will be raised when attempting
|
||||
to use unsupported constructs from the old API.
|
||||
|
||||
.. versionadded:: 1.5.2+
|
||||
.. versionadded:: 1.6
|
||||
"""
|
||||
|
||||
@ -434,7 +434,7 @@ class GridOutIterator(object):
|
||||
class GridFile(object):
|
||||
"""No longer supported.
|
||||
|
||||
.. versionchanged:: 1.5.2+
|
||||
.. versionchanged:: 1.6
|
||||
The GridFile class is no longer supported.
|
||||
"""
|
||||
def __init__(self, *args, **kwargs):
|
||||
|
||||
@ -38,7 +38,7 @@ SLOW_ONLY = 1
|
||||
ALL = 2
|
||||
"""Profile all operations."""
|
||||
|
||||
version = "1.5.2+"
|
||||
version = "1.6"
|
||||
"""Current version of PyMongo."""
|
||||
|
||||
Connection = PyMongo_Connection
|
||||
|
||||
@ -280,7 +280,7 @@ class Database(object):
|
||||
- `**kwargs` (optional): additional keyword arguments will
|
||||
be added to the command document before it is sent
|
||||
|
||||
.. versionchanged:: 1.5.2+
|
||||
.. versionchanged:: 1.6
|
||||
Added the `value` argument for string commands, and keyword
|
||||
arguments for additional command options.
|
||||
.. versionchanged:: 1.5
|
||||
|
||||
@ -105,7 +105,7 @@ class ObjectId(object):
|
||||
- `generation_time`: :class:`~datetime.datetime` to be used
|
||||
as the generation time for the resulting ObjectId.
|
||||
|
||||
.. versionadded:: 1.5.2+
|
||||
.. versionadded:: 1.6
|
||||
"""
|
||||
ts = calendar.timegm(generation_time.timetuple())
|
||||
oid = struct.pack(">i", int(ts)) + "\x00" * 8
|
||||
|
||||
Loading…
Reference in New Issue
Block a user