From 1da312ea43ebb58cd0c246f3705af2921921134b Mon Sep 17 00:00:00 2001 From: "A. Jesse Jiryu Davis" Date: Fri, 5 Oct 2012 18:28:15 -0700 Subject: [PATCH] Fix up read-preferences documentation --- doc/api/pymongo/collection.rst | 2 +- doc/api/pymongo/database.rst | 2 +- pymongo/common.py | 16 ++++++++-------- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/doc/api/pymongo/collection.rst b/doc/api/pymongo/collection.rst index 7ebd0bfa5..489c921d3 100644 --- a/doc/api/pymongo/collection.rst +++ b/doc/api/pymongo/collection.rst @@ -20,10 +20,10 @@ .. autoattribute:: full_name .. autoattribute:: name .. autoattribute:: database - .. autoattribute:: slave_okay .. autoattribute:: read_preference .. autoattribute:: tag_sets .. autoattribute:: secondary_acceptable_latency_ms + .. autoattribute:: slave_okay .. autoattribute:: safe .. autoattribute:: uuid_subtype .. automethod:: get_lasterror_options diff --git a/doc/api/pymongo/database.rst b/doc/api/pymongo/database.rst index 359d6a949..6cf0afef1 100644 --- a/doc/api/pymongo/database.rst +++ b/doc/api/pymongo/database.rst @@ -18,10 +18,10 @@ Raises :class:`~pymongo.errors.InvalidName` if an invalid collection name is used. - .. autoattribute:: slave_okay .. autoattribute:: read_preference .. autoattribute:: tag_sets .. autoattribute:: secondary_acceptable_latency_ms + .. autoattribute:: slave_okay .. autoattribute:: safe .. automethod:: get_lasterror_options .. automethod:: set_lasterror_options diff --git a/pymongo/common.py b/pymongo/common.py index f1376515c..b0cb0c235 100644 --- a/pymongo/common.py +++ b/pymongo/common.py @@ -281,8 +281,8 @@ class BaseObject(object): def __get_acceptable_latency(self): """Any replica-set member whose ping time is within - secondary_acceptable_latency_ms of the nearest member may accept - reads. Defaults to 15 milliseconds. + secondary_acceptable_latency_ms of the nearest member may accept + reads. Defaults to 15 milliseconds. See :class:`~pymongo.read_preferences.ReadPreference`. @@ -300,12 +300,12 @@ class BaseObject(object): def __get_tag_sets(self): """Set ``tag_sets`` to a list of dictionaries like [{'dc': 'ny'}] to - read only from members whose ``dc`` tag has the value ``"ny"``. - To specify a priority-order for tag sets, provide a list of - tag sets: ``[{'dc': 'ny'}, {'dc': 'la'}, {}]``. A final, empty tag - set, ``{}``, means "read from any member that matches the mode, - ignoring tags." ReplicaSetConnection tries each set of tags in turn - until it finds a set of tags with at least one matching member. + read only from members whose ``dc`` tag has the value ``"ny"``. + To specify a priority-order for tag sets, provide a list of + tag sets: ``[{'dc': 'ny'}, {'dc': 'la'}, {}]``. A final, empty tag + set, ``{}``, means "read from any member that matches the mode, + ignoring tags." ReplicaSetConnection tries each set of tags in turn + until it finds a set of tags with at least one matching member. .. seealso:: `Data-Center Awareness `_