Skip to content

Commit 87babaa

Browse files
authored
Merge pull request #2439 from bagerard/improve_doc
Improve Fields documentation
2 parents 9ffe0bc + a190dfe commit 87babaa

File tree

7 files changed

+47
-192
lines changed

7 files changed

+47
-192
lines changed

docs/guide/gridfs.rst

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
GridFS
33
======
44

5-
.. versionadded:: 0.4
6-
75
Writing
86
-------
97

mongoengine/base/fields.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@
1616
class BaseField:
1717
"""A base class for fields in a MongoDB document. Instances of this class
1818
may be added to subclasses of `Document` to define a document's schema.
19-
20-
.. versionchanged:: 0.5 - added verbose and help text
2119
"""
2220

2321
name = None
@@ -265,8 +263,6 @@ class ComplexBaseField(BaseField):
265263
Allows for nesting of embedded documents inside complex types.
266264
Handles the lazy dereferencing of a queryset by lazily dereferencing all
267265
items in a list / dict rather than one at a time.
268-
269-
.. versionadded:: 0.5
270266
"""
271267

272268
field = None
@@ -521,8 +517,6 @@ def validate(self, value):
521517

522518
class GeoJsonBaseField(BaseField):
523519
"""A geo json field storing a geojson style object.
524-
525-
.. versionadded:: 0.8
526520
"""
527521

528522
_geo_index = pymongo.GEOSPHERE

mongoengine/connection.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,6 @@ def _get_connection_settings(
7474
: param kwargs: ad-hoc parameters to be passed into the pymongo driver,
7575
for example maxpoolsize, tz_aware, etc. See the documentation
7676
for pymongo's `MongoClient` for a full list.
77-
78-
.. versionchanged:: 0.10.6 - added mongomock support
7977
"""
8078
conn_settings = {
8179
"name": name or db or DEFAULT_DATABASE_NAME,
@@ -201,8 +199,6 @@ def register_connection(
201199
: param kwargs: ad-hoc parameters to be passed into the pymongo driver,
202200
for example maxpoolsize, tz_aware, etc. See the documentation
203201
for pymongo's `MongoClient` for a full list.
204-
205-
.. versionchanged:: 0.10.6 - added mongomock support
206202
"""
207203
conn_settings = _get_connection_settings(
208204
db=db,
@@ -386,8 +382,6 @@ def connect(db=None, alias=DEFAULT_CONNECTION_NAME, **kwargs):
386382
387383
See the docstring for `register_connection` for more details about all
388384
supported kwargs.
389-
390-
.. versionchanged:: 0.6 - added multiple database support.
391385
"""
392386
if alias in _connections:
393387
prev_conn_setting = _connection_settings[alias]

mongoengine/document.py

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import re
2-
import warnings
32

43
from bson.dbref import DBRef
54
import pymongo
@@ -367,15 +366,6 @@ def save(
367366
meta['cascade'] = True. Also you can pass different kwargs to
368367
the cascade save using cascade_kwargs which overwrites the
369368
existing kwargs with custom values.
370-
.. versionchanged:: 0.8.5
371-
Optional save_condition that only overwrites existing documents
372-
if the condition is satisfied in the current db record.
373-
.. versionchanged:: 0.10
374-
:class:`OperationError` exception raised if save_condition fails.
375-
.. versionchanged:: 0.10.1
376-
:class: save_condition failure now raises a `SaveConditionError`
377-
.. versionchanged:: 0.10.7
378-
Add signal_kwargs argument
379369
"""
380370
signal_kwargs = signal_kwargs or {}
381371

@@ -630,9 +620,6 @@ def delete(self, signal_kwargs=None, **write_concern):
630620
For example, ``save(..., w: 2, fsync: True)`` will
631621
wait until at least two servers have recorded the write and
632622
will force an fsync on the primary server.
633-
634-
.. versionchanged:: 0.10.7
635-
Add signal_kwargs argument
636623
"""
637624
signal_kwargs = signal_kwargs or {}
638625
signals.pre_delete.send(self.__class__, document=self, **signal_kwargs)
@@ -714,8 +701,6 @@ def switch_collection(self, collection_name, keep_created=True):
714701
def select_related(self, max_depth=1):
715702
"""Handles dereferencing of :class:`~bson.dbref.DBRef` objects to
716703
a maximum depth in order to cut down the number queries to mongodb.
717-
718-
.. versionadded:: 0.5
719704
"""
720705
DeReference = _import_class("DeReference")
721706
DeReference()([self], max_depth + 1)
@@ -726,10 +711,6 @@ def reload(self, *fields, **kwargs):
726711
727712
:param fields: (optional) args list of fields to reload
728713
:param max_depth: (optional) depth of dereferencing to follow
729-
730-
.. versionadded:: 0.1.2
731-
.. versionchanged:: 0.6 Now chainable
732-
.. versionchanged:: 0.9 Can provide specific fields to reload
733714
"""
734715
max_depth = 1
735716
if fields and isinstance(fields[0], int):
@@ -831,9 +812,6 @@ def drop_collection(cls):
831812
832813
Raises :class:`OperationError` if the document has no collection set
833814
(i.g. if it is `abstract`)
834-
835-
.. versionchanged:: 0.10.7
836-
:class:`OperationError` exception raised if no collection available
837815
"""
838816
coll_name = cls._get_collection_name()
839817
if not coll_name:
@@ -1088,8 +1066,6 @@ class MapReduceDocument:
10881066
an ``ObjectId`` found in the given ``collection``,
10891067
the object can be accessed via the ``object`` property.
10901068
:param value: The result(s) for this key.
1091-
1092-
.. versionadded:: 0.3
10931069
"""
10941070

10951071
def __init__(self, document, collection, key, value):

0 commit comments

Comments
 (0)