/usr/share/doc/python-pymongo-doc/html/api/pymongo/son_manipulator.html is in python-pymongo-doc 2.7.2-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>son_manipulator – Manipulators that can edit SON documents as they are saved or retrieved — PyMongo 2.7.2 documentation</title>
<link rel="stylesheet" href="../../_static/default.css" type="text/css" />
<link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: '../../',
VERSION: '2.7.2',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
};
</script>
<script type="text/javascript" src="../../_static/jquery.js"></script>
<script type="text/javascript" src="../../_static/underscore.js"></script>
<script type="text/javascript" src="../../_static/doctools.js"></script>
<script type="text/javascript" src="../../_static/sidebar.js"></script>
<link rel="top" title="PyMongo 2.7.2 documentation" href="../../index.html" />
<link rel="up" title="pymongo – Python driver for MongoDB" href="index.html" />
<link rel="next" title="cursor_manager – Managers to handle when cursors are killed after being closed – DEPRECATED" href="cursor_manager.html" />
<link rel="prev" title="replica_set_connection – Tools for connecting to a MongoDB replica set" href="replica_set_connection.html" />
</head>
<body>
<div class="related">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="../../genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="right" >
<a href="../../py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="right" >
<a href="cursor_manager.html" title="cursor_manager – Managers to handle when cursors are killed after being closed – DEPRECATED"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="replica_set_connection.html" title="replica_set_connection – Tools for connecting to a MongoDB replica set"
accesskey="P">previous</a> |</li>
<li><a href="../../index.html">PyMongo 2.7.2 documentation</a> »</li>
<li><a href="../index.html" >API Documentation</a> »</li>
<li><a href="index.html" accesskey="U"><tt class="docutils literal"><span class="pre">pymongo</span></tt> – Python driver for MongoDB</a> »</li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body">
<div class="section" id="module-pymongo.son_manipulator">
<span id="son-manipulator-manipulators-that-can-edit-son-documents-as-they-are-saved-or-retrieved"></span><h1><tt class="xref py py-mod docutils literal"><span class="pre">son_manipulator</span></tt> – Manipulators that can edit SON documents as they are saved or retrieved<a class="headerlink" href="#module-pymongo.son_manipulator" title="Permalink to this headline">¶</a></h1>
<p>Manipulators that can edit SON objects as they enter and exit a database.</p>
<p>New manipulators should be defined as subclasses of SONManipulator and can be
installed on a database by calling
<cite>pymongo.database.Database.add_son_manipulator</cite>.</p>
<dl class="class">
<dt id="pymongo.son_manipulator.AutoReference">
<em class="property">class </em><tt class="descclassname">pymongo.son_manipulator.</tt><tt class="descname">AutoReference</tt><big>(</big><em>db</em><big>)</big><a class="headerlink" href="#pymongo.son_manipulator.AutoReference" title="Permalink to this definition">¶</a></dt>
<dd><p>Transparently reference and de-reference already saved embedded objects.</p>
<p>This manipulator should probably only be used when the NamespaceInjector is
also being used, otherwise it doesn’t make too much sense - documents can
only be auto-referenced if they have an <em>_ns</em> field.</p>
<p>NOTE: this will behave poorly if you have a circular reference.</p>
<p>TODO: this only works for documents that are in the same database. To fix
this we’ll need to add a DatabaseInjector that adds <em>_db</em> and then make
use of the optional <em>database</em> support for DBRefs.</p>
<dl class="method">
<dt id="pymongo.son_manipulator.AutoReference.transform_incoming">
<tt class="descname">transform_incoming</tt><big>(</big><em>son</em>, <em>collection</em><big>)</big><a class="headerlink" href="#pymongo.son_manipulator.AutoReference.transform_incoming" title="Permalink to this definition">¶</a></dt>
<dd><p>Replace embedded documents with DBRefs.</p>
</dd></dl>
<dl class="method">
<dt id="pymongo.son_manipulator.AutoReference.transform_outgoing">
<tt class="descname">transform_outgoing</tt><big>(</big><em>son</em>, <em>collection</em><big>)</big><a class="headerlink" href="#pymongo.son_manipulator.AutoReference.transform_outgoing" title="Permalink to this definition">¶</a></dt>
<dd><p>Replace DBRefs with embedded documents.</p>
</dd></dl>
<dl class="method">
<dt id="pymongo.son_manipulator.AutoReference.will_copy">
<tt class="descname">will_copy</tt><big>(</big><big>)</big><a class="headerlink" href="#pymongo.son_manipulator.AutoReference.will_copy" title="Permalink to this definition">¶</a></dt>
<dd><p>We need to copy so the user’s document doesn’t get transformed refs.</p>
</dd></dl>
</dd></dl>
<dl class="class">
<dt id="pymongo.son_manipulator.NamespaceInjector">
<em class="property">class </em><tt class="descclassname">pymongo.son_manipulator.</tt><tt class="descname">NamespaceInjector</tt><a class="headerlink" href="#pymongo.son_manipulator.NamespaceInjector" title="Permalink to this definition">¶</a></dt>
<dd><p>A son manipulator that adds the _ns field.</p>
<dl class="method">
<dt id="pymongo.son_manipulator.NamespaceInjector.transform_incoming">
<tt class="descname">transform_incoming</tt><big>(</big><em>son</em>, <em>collection</em><big>)</big><a class="headerlink" href="#pymongo.son_manipulator.NamespaceInjector.transform_incoming" title="Permalink to this definition">¶</a></dt>
<dd><p>Add the _ns field to the incoming object</p>
</dd></dl>
</dd></dl>
<dl class="class">
<dt id="pymongo.son_manipulator.ObjectIdInjector">
<em class="property">class </em><tt class="descclassname">pymongo.son_manipulator.</tt><tt class="descname">ObjectIdInjector</tt><a class="headerlink" href="#pymongo.son_manipulator.ObjectIdInjector" title="Permalink to this definition">¶</a></dt>
<dd><p>A son manipulator that adds the _id field if it is missing.</p>
<div class="versionchanged">
<p><span class="versionmodified">Changed in version 2.7: </span>ObjectIdInjector is no longer used by PyMongo, but remains in this
module for backwards compatibility.</p>
</div>
<dl class="method">
<dt id="pymongo.son_manipulator.ObjectIdInjector.transform_incoming">
<tt class="descname">transform_incoming</tt><big>(</big><em>son</em>, <em>collection</em><big>)</big><a class="headerlink" href="#pymongo.son_manipulator.ObjectIdInjector.transform_incoming" title="Permalink to this definition">¶</a></dt>
<dd><p>Add an _id field if it is missing.</p>
</dd></dl>
</dd></dl>
<dl class="class">
<dt id="pymongo.son_manipulator.ObjectIdShuffler">
<em class="property">class </em><tt class="descclassname">pymongo.son_manipulator.</tt><tt class="descname">ObjectIdShuffler</tt><a class="headerlink" href="#pymongo.son_manipulator.ObjectIdShuffler" title="Permalink to this definition">¶</a></dt>
<dd><p>A son manipulator that moves _id to the first position.</p>
<dl class="method">
<dt id="pymongo.son_manipulator.ObjectIdShuffler.transform_incoming">
<tt class="descname">transform_incoming</tt><big>(</big><em>son</em>, <em>collection</em><big>)</big><a class="headerlink" href="#pymongo.son_manipulator.ObjectIdShuffler.transform_incoming" title="Permalink to this definition">¶</a></dt>
<dd><p>Move _id to the front if it’s there.</p>
</dd></dl>
<dl class="method">
<dt id="pymongo.son_manipulator.ObjectIdShuffler.will_copy">
<tt class="descname">will_copy</tt><big>(</big><big>)</big><a class="headerlink" href="#pymongo.son_manipulator.ObjectIdShuffler.will_copy" title="Permalink to this definition">¶</a></dt>
<dd><p>We need to copy to be sure that we are dealing with SON, not a dict.</p>
</dd></dl>
</dd></dl>
<dl class="class">
<dt id="pymongo.son_manipulator.SONManipulator">
<em class="property">class </em><tt class="descclassname">pymongo.son_manipulator.</tt><tt class="descname">SONManipulator</tt><a class="headerlink" href="#pymongo.son_manipulator.SONManipulator" title="Permalink to this definition">¶</a></dt>
<dd><p>A base son manipulator.</p>
<p>This manipulator just saves and restores objects without changing them.</p>
<dl class="method">
<dt id="pymongo.son_manipulator.SONManipulator.transform_incoming">
<tt class="descname">transform_incoming</tt><big>(</big><em>son</em>, <em>collection</em><big>)</big><a class="headerlink" href="#pymongo.son_manipulator.SONManipulator.transform_incoming" title="Permalink to this definition">¶</a></dt>
<dd><p>Manipulate an incoming SON object.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><cite>son</cite>: the SON object to be inserted into the database</li>
<li><cite>collection</cite>: the collection the object is being inserted into</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="method">
<dt id="pymongo.son_manipulator.SONManipulator.transform_outgoing">
<tt class="descname">transform_outgoing</tt><big>(</big><em>son</em>, <em>collection</em><big>)</big><a class="headerlink" href="#pymongo.son_manipulator.SONManipulator.transform_outgoing" title="Permalink to this definition">¶</a></dt>
<dd><p>Manipulate an outgoing SON object.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><cite>son</cite>: the SON object being retrieved from the database</li>
<li><cite>collection</cite>: the collection this object was stored in</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="method">
<dt id="pymongo.son_manipulator.SONManipulator.will_copy">
<tt class="descname">will_copy</tt><big>(</big><big>)</big><a class="headerlink" href="#pymongo.son_manipulator.SONManipulator.will_copy" title="Permalink to this definition">¶</a></dt>
<dd><p>Will this SON manipulator make a copy of the incoming document?</p>
<p>Derived classes that do need to make a copy should override this
method, returning True instead of False. All non-copying manipulators
will be applied first (so that the user’s document will be updated
appropriately), followed by copying manipulators.</p>
</dd></dl>
</dd></dl>
</div>
</div>
</div>
</div>
<div class="sphinxsidebar">
<div class="sphinxsidebarwrapper">
<h4>Previous topic</h4>
<p class="topless"><a href="replica_set_connection.html"
title="previous chapter"><tt class="docutils literal"><span class="pre">replica_set_connection</span></tt> – Tools for connecting to a MongoDB replica set</a></p>
<h4>Next topic</h4>
<p class="topless"><a href="cursor_manager.html"
title="next chapter"><tt class="docutils literal"><span class="pre">cursor_manager</span></tt> – Managers to handle when cursors are killed after being closed – DEPRECATED</a></p>
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="../../_sources/api/pymongo/son_manipulator.txt"
rel="nofollow">Show Source</a></li>
</ul>
<div id="searchbox" style="display: none">
<h3>Quick search</h3>
<form class="search" action="../../search.html" method="get">
<input type="text" name="q" />
<input type="submit" value="Go" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
<p class="searchtip" style="font-size: 90%">
Enter search terms or a module, class or function name.
</p>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="related">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="../../genindex.html" title="General Index"
>index</a></li>
<li class="right" >
<a href="../../py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="right" >
<a href="cursor_manager.html" title="cursor_manager – Managers to handle when cursors are killed after being closed – DEPRECATED"
>next</a> |</li>
<li class="right" >
<a href="replica_set_connection.html" title="replica_set_connection – Tools for connecting to a MongoDB replica set"
>previous</a> |</li>
<li><a href="../../index.html">PyMongo 2.7.2 documentation</a> »</li>
<li><a href="../index.html" >API Documentation</a> »</li>
<li><a href="index.html" ><tt class="docutils literal"><span class="pre">pymongo</span></tt> – Python driver for MongoDB</a> »</li>
</ul>
</div>
<div class="footer">
© Copyright 2008 - 2014, MongoDB, Inc..
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.2.3.
</div>
</body>
</html>
|