BUMP 1.8 - see changelog for details
This commit is contained in:
parent
7a79560f5f
commit
a3a8cf2d79
@ -1,10 +1,54 @@
|
||||
Changelog
|
||||
=========
|
||||
|
||||
Changes in Version 1.8
|
||||
----------------------
|
||||
|
||||
Version 1.8 adds support for connecting to replica sets, specifying
|
||||
per-operation values for `w` and `wtimeout`, and decoding to
|
||||
timezone-aware datetimes.
|
||||
|
||||
- fixed a reference leak in the C extension when decoding a
|
||||
:class:`~pymongo.dbref.DBRef`.
|
||||
- added support for `w`, `wtimeout`, and `fsync` (and any other
|
||||
options for `getLastError`) to "safe mode" operations.
|
||||
- added :attr:`~pymongo.connection.Connection.nodes` property.
|
||||
- added a maximum pool size of 10 sockets.
|
||||
- added support for replica sets.
|
||||
- DEPRECATED :meth:`~pymongo.connection.Connection.from_uri` and
|
||||
:meth:`~pymongo.connection.Connection.paired`, both are supplanted
|
||||
by extended functionality in :meth:`~pymongo.connection.Connection`.
|
||||
- added tz aware support for datetimes in
|
||||
:class:`~pymongo.objectid.ObjectId`,
|
||||
:class:`~pymongo.timestamp.Timestamp` and :mod:`~pymongo.json_util`
|
||||
methods.
|
||||
- added :meth:`~pymongo.collection.Collection.drop` helper.
|
||||
- reuse the socket used for finding the master when a
|
||||
:class:`~pymongo.connection.Connection` is first created.
|
||||
- added support for :class:`~pymongo.min_key.MinKey`,
|
||||
:class:`~pymongo.max_key.MaxKey` and
|
||||
:class:`~pymongo.timestamp.Timestamp` to :mod:`~pymongo.json_util`.
|
||||
- added support for decoding datetimes as aware (UTC) - it is highly
|
||||
recommended to enable this by setting the `tz_aware` parameter to
|
||||
:meth:`~pymongo.connection.Connection` to ``True``.
|
||||
- added `network_timeout` option for individual calls to
|
||||
:meth:`~pymongo.collection.Collection.find` and
|
||||
:meth:`~pymongo.collection.Collection.find_one`.
|
||||
- added :meth:`~gridfs.GridFS.exists` to check if a file exists in
|
||||
GridFS.
|
||||
- added support for additional keys in :class:`~pymongo.dbref.DBRef`
|
||||
instances.
|
||||
- added :attr:`~pymongo.errors.OperationFailure.code` attribute to
|
||||
:class:`~pymongo.errors.OperationFailure` exceptions.
|
||||
- fixed serialization of int and float subclasses in the C extension.
|
||||
|
||||
Changes in Version 1.7
|
||||
----------------------
|
||||
|
||||
Version 1.7 is a recommended upgrade for all PyMongo users. The full release notes are below, and some more in depth discussion of the highlights is `here <http://dirolf.com/2010/06/17/pymongo-1.7-released.html>`_.
|
||||
Version 1.7 is a recommended upgrade for all PyMongo users. The full
|
||||
release notes are below, and some more in depth discussion of the
|
||||
highlights is `here
|
||||
<http://dirolf.com/2010/06/17/pymongo-1.7-released.html>`_.
|
||||
|
||||
- no longer attempt to build the C extension on big-endian systems.
|
||||
- added :class:`~pymongo.min_key.MinKey` and
|
||||
|
||||
@ -212,7 +212,7 @@ class GridFS(object):
|
||||
- `**kwargs` (optional): keyword arguments are used as a
|
||||
query document, if they're present.
|
||||
|
||||
.. versionadded:: 1.7+
|
||||
.. versionadded:: 1.8
|
||||
"""
|
||||
if kwargs:
|
||||
return self.__files.find_one(kwargs) is not None
|
||||
|
||||
@ -39,7 +39,7 @@ ALL = 2
|
||||
"""Profile all operations."""
|
||||
|
||||
# Remember to change in setup.py as well!
|
||||
version = "1.7+"
|
||||
version = "1.8"
|
||||
"""Current version of PyMongo."""
|
||||
|
||||
Connection = PyMongo_Connection
|
||||
|
||||
@ -459,7 +459,7 @@ class BSON(str):
|
||||
- `tz_aware` (optional): if ``True``, return timezone-aware
|
||||
:class:`~datetime.datetime` instances
|
||||
|
||||
.. versionadded:: 1.7+
|
||||
.. versionadded:: 1.8
|
||||
The `tz_aware` parameter.
|
||||
.. versionadded:: 1.7
|
||||
The `as_class` parameter.
|
||||
|
||||
@ -195,7 +195,7 @@ class Collection(object):
|
||||
``safe=True``, and will be used as options for the
|
||||
`getLastError` command
|
||||
|
||||
.. versionadded:: 1.7+
|
||||
.. versionadded:: 1.8
|
||||
Support for passing `getLastError` options as keyword
|
||||
arguments.
|
||||
|
||||
@ -246,7 +246,7 @@ class Collection(object):
|
||||
``safe=True``, and will be used as options for the
|
||||
`getLastError` command
|
||||
|
||||
.. versionadded:: 1.7+
|
||||
.. versionadded:: 1.8
|
||||
Support for passing `getLastError` options as keyword
|
||||
arguments.
|
||||
.. versionchanged:: 1.1
|
||||
@ -333,7 +333,7 @@ class Collection(object):
|
||||
``safe=True``, and will be used as options for the
|
||||
`getLastError` command
|
||||
|
||||
.. versionadded:: 1.7+
|
||||
.. versionadded:: 1.8
|
||||
Support for passing `getLastError` options as keyword
|
||||
arguments.
|
||||
.. versionchanged:: 1.4
|
||||
@ -370,7 +370,7 @@ class Collection(object):
|
||||
>>> db.foo.drop()
|
||||
>>> db.drop_collection("foo")
|
||||
|
||||
.. versionadded:: 1.7+
|
||||
.. versionadded:: 1.8
|
||||
"""
|
||||
self.__database.drop_collection(self.__name)
|
||||
|
||||
@ -408,7 +408,7 @@ class Collection(object):
|
||||
``safe=True``, and will be used as options for the
|
||||
`getLastError` command
|
||||
|
||||
.. versionadded:: 1.7+
|
||||
.. versionadded:: 1.8
|
||||
Support for passing `getLastError` options as keyword arguments.
|
||||
.. versionchanged:: 1.7
|
||||
Accept any type other than a ``dict`` instance for removal
|
||||
@ -536,7 +536,7 @@ class Collection(object):
|
||||
.. note:: The `max_scan` parameter requires server
|
||||
version **>= 1.5.1**
|
||||
|
||||
.. versionadded:: 1.7+
|
||||
.. versionadded:: 1.8
|
||||
The `network_timeout` parameter.
|
||||
|
||||
.. versionadded:: 1.7
|
||||
|
||||
@ -215,12 +215,12 @@ class Connection(object): # TODO support auth for pooling
|
||||
aware (otherwise they will be naive)
|
||||
|
||||
.. seealso:: :meth:`end_request`
|
||||
.. versionchanged:: 1.7+
|
||||
.. versionchanged:: 1.8
|
||||
The `host` parameter can now be a full `mongodb URI
|
||||
<http://dochub.mongodb.org/core/connections>`_, in addition
|
||||
to a simple hostname. It can also be a list of hostnames or
|
||||
URIs.
|
||||
.. versionadded:: 1.7+
|
||||
.. versionadded:: 1.8
|
||||
The `tz_aware` parameter.
|
||||
.. versionadded:: 1.7
|
||||
The `document_class` parameter.
|
||||
@ -299,7 +299,7 @@ class Connection(object): # TODO support auth for pooling
|
||||
def from_uri(cls, uri="mongodb://localhost", **connection_args):
|
||||
"""DEPRECATED Can pass a mongodb URI directly to Connection() instead.
|
||||
|
||||
.. versionchanged:: 1.7+
|
||||
.. versionchanged:: 1.8
|
||||
DEPRECATED
|
||||
.. versionadded:: 1.5
|
||||
"""
|
||||
@ -311,7 +311,7 @@ class Connection(object): # TODO support auth for pooling
|
||||
def paired(cls, left, right=None, **connection_args):
|
||||
"""DEPRECATED Can pass a list of hostnames to Connection() instead.
|
||||
|
||||
.. versionchanged:: 1.7+
|
||||
.. versionchanged:: 1.8
|
||||
DEPRECATED
|
||||
"""
|
||||
warnings.warn("Connection.paired is deprecated - can pass multiple "
|
||||
@ -403,7 +403,7 @@ class Connection(object): # TODO support auth for pooling
|
||||
created, as well as nodes discovered through the replica set
|
||||
discovery mechanism.
|
||||
|
||||
.. versionadded:: 1.7+
|
||||
.. versionadded:: 1.8
|
||||
"""
|
||||
return self.__nodes
|
||||
|
||||
@ -432,7 +432,7 @@ class Connection(object): # TODO support auth for pooling
|
||||
|
||||
See the `tz_aware` parameter to :meth:`Connection`.
|
||||
|
||||
.. versionadded:: 1.7+
|
||||
.. versionadded:: 1.8
|
||||
"""
|
||||
return self.__tz_aware
|
||||
|
||||
|
||||
@ -37,7 +37,7 @@ class DBRef(object):
|
||||
- `**kwargs` (optional): additional keyword arguments will
|
||||
create additional, custom fields
|
||||
|
||||
.. versionchanged:: 1.7+
|
||||
.. versionchanged:: 1.8
|
||||
Now takes keyword arguments to specify additional fields.
|
||||
.. versionadded:: 1.1.1
|
||||
The `database` parameter.
|
||||
|
||||
@ -47,7 +47,7 @@ class ConfigurationError(PyMongoError):
|
||||
class OperationFailure(PyMongoError):
|
||||
"""Raised when a database operation fails.
|
||||
|
||||
.. versionadded:: 1.7+
|
||||
.. versionadded:: 1.8
|
||||
The :attr:`code` attribute.
|
||||
"""
|
||||
|
||||
@ -59,7 +59,7 @@ class OperationFailure(PyMongoError):
|
||||
class TimeoutError(OperationFailure):
|
||||
"""Raised when a database operation times out.
|
||||
|
||||
.. versionadded:: 1.7+
|
||||
.. versionadded:: 1.8
|
||||
"""
|
||||
|
||||
|
||||
|
||||
@ -34,11 +34,11 @@ Currently this does not handle special encoding and decoding for
|
||||
:class:`~pymongo.binary.Binary` and :class:`~pymongo.code.Code`
|
||||
instances.
|
||||
|
||||
.. versionchanged:: 1.7+
|
||||
.. versionchanged:: 1.8
|
||||
Handle timezone aware datetime instances on encode, decode to
|
||||
timezone aware datetime instances.
|
||||
|
||||
.. versionchanged:: 1.7+
|
||||
.. versionchanged:: 1.8
|
||||
Added support for encoding/decoding
|
||||
:class:`~pymongo.max_key.MaxKey` and
|
||||
:class:`~pymongo.min_key.MinKey`, and for encoding
|
||||
|
||||
@ -103,7 +103,7 @@ class ObjectId(object):
|
||||
- `generation_time`: :class:`~datetime.datetime` to be used
|
||||
as the generation time for the resulting ObjectId.
|
||||
|
||||
.. versionchanged:: 1.7+
|
||||
.. versionchanged:: 1.8
|
||||
Properly handle timezone aware values for
|
||||
`generation_time`.
|
||||
|
||||
@ -177,7 +177,7 @@ class ObjectId(object):
|
||||
represents the generation time in UTC. It is precise to the
|
||||
second.
|
||||
|
||||
.. versionchanged:: 1.7+
|
||||
.. versionchanged:: 1.8
|
||||
Now return an aware datetime instead of a naive one.
|
||||
|
||||
.. versionadded:: 1.2
|
||||
|
||||
@ -87,7 +87,7 @@ class Timestamp(object):
|
||||
"""Return a :class:`~datetime.datetime` instance corresponding
|
||||
to the time portion of this :class:`Timestamp`.
|
||||
|
||||
.. versionchanged:: 1.7+
|
||||
.. versionchanged:: 1.8
|
||||
The returned datetime is now timezone aware.
|
||||
"""
|
||||
return datetime.datetime.fromtimestamp(self.__time, utc)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user