Skip to content

Commit ea2a2b6

Browse files
author
Mike Dirolf
committed
dochub links
1 parent b09a95c commit ea2a2b6

File tree

8 files changed

+42
-1
lines changed

8 files changed

+42
-1
lines changed

doc/mongo_extensions.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,6 @@ def process_mongodoc_nodes(app, doctree, fromdocname):
8282
new_para = nodes.paragraph()
8383
new_para += link
8484
node.replace(para, new_para)
85-
break
8685

8786

8887
def setup(app):

gridfs/__init__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
1717
The :mod:`gridfs` package is an implementation of GridFS on top of
1818
:mod:`pymongo`, exposing a file-like interface.
19+
20+
.. mongodoc:: gridfs
1921
"""
2022

2123
from gridfs.grid_file import GridFile
@@ -32,6 +34,8 @@ def __init__(self, database):
3234
3335
:Parameters:
3436
- `database`: database to use
37+
38+
.. mongodoc:: gridfs
3539
"""
3640
if not isinstance(database, Database):
3741
raise TypeError("database must be an instance of Database")

pymongo/collection.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ def __init__(self, database, name, options=None):
4949
- `options`: dictionary of collection options. see
5050
:meth:`~pymongo.database.Database.create_collection` for
5151
details.
52+
53+
.. mongodoc:: collections
5254
"""
5355
if not isinstance(name, basestring):
5456
raise TypeError("name must be an instance of basestring")
@@ -169,6 +171,8 @@ def save(self, to_save, manipulate=True, safe=False):
169171
- `to_save`: the SON object to be saved
170172
- `manipulate` (optional): manipulate the SON object before saving it
171173
- `safe` (optional): check that the save succeeded?
174+
175+
.. mongodoc:: insert
172176
"""
173177
if not isinstance(to_save, dict):
174178
raise TypeError("cannot save object of type %s" % type(to_save))
@@ -201,6 +205,8 @@ def insert(self, doc_or_docs,
201205
202206
.. versionchanged:: 1.1
203207
Bulk insert works with any iterable
208+
209+
.. mongodoc:: insert
204210
"""
205211
docs = doc_or_docs
206212
if isinstance(docs, dict):
@@ -275,6 +281,8 @@ def update(self, spec, document,
275281
276282
.. _update modifiers: http://www.mongodb.org/display/DOCS/Updating
277283
.. _upsert: http://www.mongodb.org/display/DOCS/Updating#Updating-Upserts
284+
285+
.. mongodoc:: update
278286
"""
279287
if not isinstance(spec, dict):
280288
raise TypeError("spec must be an instance of dict")
@@ -328,6 +336,8 @@ def remove(self, spec_or_object_id=None, safe=False):
328336
removed.
329337
.. versionadded:: 1.1
330338
The `safe` parameter.
339+
340+
.. mongodoc:: remove
331341
"""
332342
spec = spec_or_object_id
333343
if spec is None:
@@ -511,6 +521,8 @@ def create_index(self, key_or_list, unique=False, ttl=300):
511521
.. seealso:: :meth:`ensure_index`
512522
513523
.. _compound index: http://www.mongodb.org/display/DOCS/Indexes#Indexes-CompoundKeysIndexes
524+
525+
.. mongodoc:: indexes
514526
"""
515527
if not isinstance(key_or_list, (str, unicode, list)):
516528
raise TypeError("key_or_list must either be a single key "
@@ -774,6 +786,8 @@ def map_reduce(self, map, reduce, full_response=False, **kwargs):
774786
.. versionadded:: 1.2
775787
776788
.. _map reduce command: http://www.mongodb.org/display/DOCS/MapReduce
789+
790+
.. mongodoc:: mapreduce
777791
"""
778792
command = SON([("mapreduce", self.__name),
779793
("map", map), ("reduce", reduce)])

pymongo/connection.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,8 @@ def __init__(self, host=None, port=None, pool_size=None,
132132
parameters.
133133
.. versionadded:: 1.1
134134
The `network_timeout` parameter.
135+
136+
.. mongodoc:: connections
135137
"""
136138
if host is None:
137139
host = self.HOST

pymongo/cursor.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ def __init__(self, collection, spec, fields, skip, limit, slave_okay,
4242
"""Create a new cursor.
4343
4444
Should not be called directly by application developers.
45+
46+
.. mongodoc:: cursors
4547
"""
4648
self.__collection = collection
4749
self.__spec = spec
@@ -166,6 +168,8 @@ def limit(self, limit):
166168
167169
:Parameters:
168170
- `limit`: the number of results to return
171+
172+
.. mongodoc:: limit
169173
"""
170174
if not isinstance(limit, int):
171175
raise TypeError("limit must be an int")
@@ -340,6 +344,8 @@ def distinct(self, key):
340344

341345
def explain(self):
342346
"""Returns an explain plan record for this cursor.
347+
348+
.. mongodoc:: explain
343349
"""
344350
c = self.clone()
345351
c.__explain = True

pymongo/database.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ def __init__(self, connection, name):
5050
- `connection`: a :class:`~pymongo.connection.Connection`
5151
instance
5252
- `name`: database name
53+
54+
.. mongodoc:: databases
5355
"""
5456
if not isinstance(name, basestring):
5557
raise TypeError("name must be an instance of basestring")
@@ -234,6 +236,8 @@ def command(self, command, check=True, allowable_errors=[], _sock=None):
234236
.. versionchanged:: 1.4+
235237
`command` can be a string in addition to a full document.
236238
.. versionadded:: 1.4
239+
240+
.. mongodoc:: commands
237241
"""
238242

239243
if isinstance(command, str):
@@ -308,6 +312,8 @@ def profiling_level(self):
308312
309313
Returns one of (:data:`~pymongo.OFF`,
310314
:data:`~pymongo.SLOW_ONLY`, :data:`~pymongo.ALL`).
315+
316+
.. mongodoc:: profiling
311317
"""
312318
result = self.command({"profile": -1})
313319

@@ -323,6 +329,8 @@ def set_profiling_level(self, level):
323329
324330
:Parameters:
325331
- `level`: the profiling level to use
332+
333+
.. mongodoc:: profiling
326334
"""
327335
if not isinstance(level, int) or level < 0 or level > 2:
328336
raise ValueError("level must be one of (OFF, SLOW_ONLY, ALL)")
@@ -331,6 +339,8 @@ def set_profiling_level(self, level):
331339

332340
def profiling_info(self):
333341
"""Returns a list containing current profiling information.
342+
343+
.. mongodoc:: profiling
334344
"""
335345
return list(self["system.profile"].find())
336346

@@ -463,6 +473,8 @@ def authenticate(self, name, password):
463473
:Parameters:
464474
- `name`: the name of the user to authenticate
465475
- `password`: the password of the user to authenticate
476+
477+
.. mongodoc:: authenticate
466478
"""
467479
if not isinstance(name, basestring):
468480
raise TypeError("name must be an instance of basestring")

pymongo/dbref.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ def __init__(self, collection, id, database=None):
3535
3636
.. versionadded:: 1.1.1
3737
The `database` parameter.
38+
39+
.. mongodoc:: dbrefs
3840
"""
3941
if not isinstance(collection, basestring):
4042
raise TypeError("collection must be an instance of basestring")

pymongo/objectid.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,8 @@ def __init__(self, oid=None):
6868
hexadecimal digits).
6969
7070
.. _ObjectId: http://www.mongodb.org/display/DOCS/Object+IDs
71+
72+
.. mongodoc:: objectids
7173
"""
7274
if oid is None:
7375
self.__generate()

0 commit comments

Comments
 (0)