Skip to content

Commit f2029b1

Browse files
author
Mike Dirolf
committed
BUMP 1.6 -- see changelog for details
1 parent b0aa2b3 commit f2029b1

File tree

8 files changed

+51
-16
lines changed

8 files changed

+51
-16
lines changed

doc/changelog.rst

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,33 @@
11
Changelog
22
=========
33

4+
Changes in Version 1.6
5+
----------------------
6+
7+
The biggest change in version 1.6 is a complete re-implementation of
8+
:mod:`gridfs` with a lot of improvements over the old
9+
implementation. There are many details and examples of using the new
10+
API in `this blog post
11+
<http://dirolf.com/2010/03/29/new-gridfs-implementation-for-pymongo.html>`_. The
12+
old API has been removed in this version, so existing code will need
13+
to be modified before upgrading to 1.6.
14+
15+
- fixed issue where connection pool was being shared across
16+
:class:`~pymongo.connection.Connection` instances.
17+
- more improvements to Python code caching in C extension - should
18+
improve behavior on mod_wsgi.
19+
- added :meth:`~pymongo.objectid.ObjectId.from_datetime`.
20+
- complete rewrite of :mod:`gridfs` support.
21+
- improvements to the :meth:`~pymongo.database.Database.command` API.
22+
- fixed :meth:`~pymongo.collection.Collection.drop_indexes` behavior
23+
on non-existent collections.
24+
- disallow empty bulk inserts.
25+
26+
Changes in Version 1.5.2
27+
------------------------
28+
- fixed response handling to ignore unknown response flags in queries.
29+
- handle server versions containing '-pre-'.
30+
431
Changes in Version 1.5.1
532
------------------------
633
- added :data:`~gridfs.grid_file.GridFile._id` property for

doc/examples/gridfs.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
GridFS Example
22
==============
33

4+
.. warning::
5+
6+
This example is out of date, and documents the API for GridFS in
7+
PyMongo versions < 1.6. If you are using a version of PyMongo that
8+
is >= 1.6 please see `this blog post
9+
<http://dirolf.com/2010/03/29/new-gridfs-implementation-for-pymongo.html>`_
10+
for an overview of how the new API works.
11+
412
.. testsetup::
513

614
from pymongo import Connection

gridfs/__init__.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ def __init__(self, database, collection="fs"):
4141
- `database`: database to use
4242
- `collection` (optional): root collection to use
4343
44-
.. versionadded:: 1.5.2+
44+
.. versionadded:: 1.6
4545
The `collection` parameter.
4646
4747
.. mongodoc:: gridfs
@@ -66,7 +66,7 @@ def new_file(self, **kwargs):
6666
:Parameters:
6767
- `**kwargs` (optional): keyword arguments for file creation
6868
69-
.. versionadded:: 1.5.2+
69+
.. versionadded:: 1.6
7070
"""
7171
return GridIn(self.__collection, **kwargs)
7272

@@ -91,7 +91,7 @@ def put(self, data, **kwargs):
9191
- `data`: data to be written as a file.
9292
- `**kwargs` (optional): keyword arguments for file creation
9393
94-
.. versionadded:: 1.5.2+
94+
.. versionadded:: 1.6
9595
"""
9696
grid_file = GridIn(self.__collection, **kwargs)
9797
try:
@@ -109,7 +109,7 @@ def get(self, file_id):
109109
:Parameters:
110110
- `file_id`: ``"_id"`` of the file to get
111111
112-
.. versionadded:: 1.5.2+
112+
.. versionadded:: 1.6
113113
"""
114114
return GridOut(self.__collection, file_id)
115115

@@ -128,7 +128,7 @@ def get_last_version(self, filename):
128128
:Parameters:
129129
- `filename`: ``"filename"`` of the file to get
130130
131-
.. versionadded:: 1.5.2+
131+
.. versionadded:: 1.6
132132
"""
133133
self.__files.ensure_index([("filename", ASCENDING),
134134
("uploadDate", DESCENDING)])
@@ -156,7 +156,7 @@ def delete(self, file_id):
156156
:Parameters:
157157
- `file_id`: ``"_id"`` of the file to delete
158158
159-
.. versionadded:: 1.5.2+
159+
.. versionadded:: 1.6
160160
"""
161161
self.__files.remove({"_id": file_id}, safe=True)
162162
self.__chunks.remove({"files_id": file_id})
@@ -165,23 +165,23 @@ def list(self):
165165
"""List the names of all files stored in this instance of
166166
:class:`GridFS`.
167167
168-
.. versionchanged:: 1.5.2+
168+
.. versionchanged:: 1.6
169169
Removed the `collection` argument.
170170
"""
171171
return self.__files.distinct("filename")
172172

173173
def open(self, *args, **kwargs):
174174
"""No longer supported.
175175
176-
.. versionchanged:: 1.5.2+
176+
.. versionchanged:: 1.6
177177
The open method is no longer supported.
178178
"""
179179
raise UnsupportedAPI("The open method is no longer supported.")
180180

181181
def remove(self, *args, **kwargs):
182182
"""No longer supported.
183183
184-
.. versionchanged:: 1.5.2+
184+
.. versionchanged:: 1.6
185185
The remove method is no longer supported.
186186
"""
187187
raise UnsupportedAPI("The remove method is no longer supported. "

gridfs/errors.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,17 +32,17 @@ class CorruptGridFile(GridFSError):
3232
class NoFile(GridFSError):
3333
"""Raised when trying to read from a non-existent file.
3434
35-
.. versionadded:: 1.5.2+
35+
.. versionadded:: 1.6
3636
"""
3737

3838
class UnsupportedAPI(GridFSError):
3939
"""Raised when trying to use the old GridFS API.
4040
41-
In version 1.5.2+ of the PyMongo distribution there were backwards
41+
In version 1.6 of the PyMongo distribution there were backwards
4242
incompatible changes to the GridFS API. Upgrading shouldn't be
4343
difficult, but the old API is no longer supported (with no
4444
deprecation period). This exception will be raised when attempting
4545
to use unsupported constructs from the old API.
4646
47-
.. versionadded:: 1.5.2+
47+
.. versionadded:: 1.6
4848
"""

gridfs/grid_file.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -434,7 +434,7 @@ def next(self):
434434
class GridFile(object):
435435
"""No longer supported.
436436
437-
.. versionchanged:: 1.5.2+
437+
.. versionchanged:: 1.6
438438
The GridFile class is no longer supported.
439439
"""
440440
def __init__(self, *args, **kwargs):

pymongo/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
ALL = 2
3939
"""Profile all operations."""
4040

41-
version = "1.5.2+"
41+
version = "1.6"
4242
"""Current version of PyMongo."""
4343

4444
Connection = PyMongo_Connection

pymongo/database.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ def command(self, command, value=1,
280280
- `**kwargs` (optional): additional keyword arguments will
281281
be added to the command document before it is sent
282282
283-
.. versionchanged:: 1.5.2+
283+
.. versionchanged:: 1.6
284284
Added the `value` argument for string commands, and keyword
285285
arguments for additional command options.
286286
.. versionchanged:: 1.5

pymongo/objectid.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ def from_datetime(cls, generation_time):
105105
- `generation_time`: :class:`~datetime.datetime` to be used
106106
as the generation time for the resulting ObjectId.
107107
108-
.. versionadded:: 1.5.2+
108+
.. versionadded:: 1.6
109109
"""
110110
ts = calendar.timegm(generation_time.timetuple())
111111
oid = struct.pack(">i", int(ts)) + "\x00" * 8

0 commit comments

Comments
 (0)