File: exceptions.html

package info (click to toggle)
sqlalchemy 0.9.8%2Bdfsg-0.1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 23,952 kB
  • ctags: 24,534
  • sloc: python: 152,282; ansic: 1,346; makefile: 257; xml: 17
file content (288 lines) | stat: -rw-r--r-- 12,101 bytes parent folder | download
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
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
<!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>
            
    
                ORM Exceptions
             &mdash;
    SQLAlchemy 0.9 Documentation

        </title>

        
            <!-- begin iterate through SQLA + sphinx environment css_files -->
                <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
                <link rel="stylesheet" href="../_static/docs.css" type="text/css" />
                <link rel="stylesheet" href="../_static/sphinx_paramlinks.css" type="text/css" />
                <link rel="stylesheet" href="../_static/changelog.css" type="text/css" />
            <!-- end iterate through SQLA + sphinx environment css_files -->
        

        

    

    <!-- begin layout.mako headers -->

    <script type="text/javascript">
      var DOCUMENTATION_OPTIONS = {
          URL_ROOT:    '../',
          VERSION:     '0.9.8',
          COLLAPSE_MODINDEX: false,
          FILE_SUFFIX: '.html'
      };
    </script>

    <!-- begin iterate through sphinx environment script_files -->
        <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>
    <!-- end iterate through sphinx environment script_files -->

    <script type="text/javascript" src="../_static/detectmobile.js"></script>
    <script type="text/javascript" src="../_static/init.js"></script>
    <link rel="index" title="Index" href="../genindex.html" />
    <link rel="search" title="Search" href="../search.html" />
        <link rel="copyright" title="Copyright" href="../copyright.html" />
    <link rel="top" title="SQLAlchemy 0.9 Documentation" href="../index.html" />
        <link rel="up" title="SQLAlchemy ORM" href="index.html" />
        <link rel="next" title="ORM Internals" href="internals.html" />
        <link rel="prev" title="ORM Examples" href="examples.html" />
    <!-- end layout.mako headers -->


    </head>
    <body>
        















<div id="docs-container">





<div id="docs-top-navigation-container" class="body-background">
<div id="docs-header">
    <div id="docs-version-header">
        Release: <span class="version-num">0.9.8</span> | Release Date: October 13, 2014
    </div>

    <h1>SQLAlchemy 0.9 Documentation</h1>

</div>
</div>

<div id="docs-body-container">

    <div id="fixed-sidebar" class="withsidebar">


        <div id="docs-sidebar-popout">
            <h3><a href="../index.html">SQLAlchemy 0.9 Documentation</a></h3>

            <p id="sidebar-paginate">
                    <a href="index.html" title="SQLAlchemy ORM">Up</a> |

                    <a href="examples.html" title="ORM Examples">Prev</a> |
                    <a href="internals.html" title="ORM Internals">Next</a>
            </p>

            <p id="sidebar-topnav">
                <a href="../index.html">Contents</a> |
                <a href="../genindex.html">Index</a>
            </p>

            <div id="sidebar-search">
                <form class="search" action="../search.html" method="get">
                  <input type="text" name="q" size="12" /> <input type="submit" value="Search" />
                  <input type="hidden" name="check_keywords" value="yes" />
                  <input type="hidden" name="area" value="default" />
                </form>
            </div>

        </div>

        <div id="docs-sidebar">

        <h3><a href="#">            
                ORM Exceptions
            
        </a></h3>
        <ul>
<li><a class="reference internal" href="#">ORM Exceptions</a></li>
</ul>




        </div>

    </div>

    

    <div id="docs-body" class="withsidebar" >
        
<div class="section" id="module-sqlalchemy.orm.exc">
<span id="orm-exceptions"></span><h1>ORM Exceptions<a class="headerlink" href="#module-sqlalchemy.orm.exc" title="Permalink to this headline">¶</a></h1>
<p>SQLAlchemy ORM exceptions.</p>
<dl class="attribute">
<dt id="sqlalchemy.orm.exc.ConcurrentModificationError">
<tt class="descclassname">sqlalchemy.orm.exc.</tt><tt class="descname">ConcurrentModificationError</tt><a class="headerlink" href="#sqlalchemy.orm.exc.ConcurrentModificationError" title="Permalink to this definition">¶</a></dt>
<dd><p>alias of <a class="reference internal" href="#sqlalchemy.orm.exc.StaleDataError" title="sqlalchemy.orm.exc.StaleDataError"><tt class="xref py py-class docutils literal"><span class="pre">StaleDataError</span></tt></a></p>
</dd></dl>

<dl class="exception">
<dt id="sqlalchemy.orm.exc.DetachedInstanceError">
<em class="property">exception </em><tt class="descclassname">sqlalchemy.orm.exc.</tt><tt class="descname">DetachedInstanceError</tt><a class="headerlink" href="#sqlalchemy.orm.exc.DetachedInstanceError" title="Permalink to this definition">¶</a></dt>
<dd><p>An attempt to access unloaded attributes on a
mapped instance that is detached.</p>
</dd></dl>

<dl class="exception">
<dt id="sqlalchemy.orm.exc.FlushError">
<em class="property">exception </em><tt class="descclassname">sqlalchemy.orm.exc.</tt><tt class="descname">FlushError</tt><a class="headerlink" href="#sqlalchemy.orm.exc.FlushError" title="Permalink to this definition">¶</a></dt>
<dd><p>A invalid condition was detected during flush().</p>
</dd></dl>

<dl class="exception">
<dt id="sqlalchemy.orm.exc.MultipleResultsFound">
<em class="property">exception </em><tt class="descclassname">sqlalchemy.orm.exc.</tt><tt class="descname">MultipleResultsFound</tt><a class="headerlink" href="#sqlalchemy.orm.exc.MultipleResultsFound" title="Permalink to this definition">¶</a></dt>
<dd><p>A single database result was required but more than one were found.</p>
</dd></dl>

<dl class="data">
<dt id="sqlalchemy.orm.exc.NO_STATE">
<tt class="descclassname">sqlalchemy.orm.exc.</tt><tt class="descname">NO_STATE</tt><em class="property"> = (&lt;type 'exceptions.AttributeError'&gt;, &lt;type 'exceptions.KeyError'&gt;)</em><a class="headerlink" href="#sqlalchemy.orm.exc.NO_STATE" title="Permalink to this definition">¶</a></dt>
<dd><p>Exception types that may be raised by instrumentation implementations.</p>
</dd></dl>

<dl class="exception">
<dt id="sqlalchemy.orm.exc.NoResultFound">
<em class="property">exception </em><tt class="descclassname">sqlalchemy.orm.exc.</tt><tt class="descname">NoResultFound</tt><a class="headerlink" href="#sqlalchemy.orm.exc.NoResultFound" title="Permalink to this definition">¶</a></dt>
<dd><p>A database result was required but none was found.</p>
</dd></dl>

<dl class="exception">
<dt id="sqlalchemy.orm.exc.ObjectDeletedError">
<em class="property">exception </em><tt class="descclassname">sqlalchemy.orm.exc.</tt><tt class="descname">ObjectDeletedError</tt><big>(</big><em>state</em>, <em>msg=None</em><big>)</big><a class="headerlink" href="#sqlalchemy.orm.exc.ObjectDeletedError" title="Permalink to this definition">¶</a></dt>
<dd><p>A refresh operation failed to retrieve the database
row corresponding to an object&#8217;s known primary key identity.</p>
<p>A refresh operation proceeds when an expired attribute is
accessed on an object, or when <a class="reference internal" href="query.html#sqlalchemy.orm.query.Query.get" title="sqlalchemy.orm.query.Query.get"><tt class="xref py py-meth docutils literal"><span class="pre">Query.get()</span></tt></a> is
used to retrieve an object which is, upon retrieval, detected
as expired.   A SELECT is emitted for the target row
based on primary key; if no row is returned, this
exception is raised.</p>
<p>The true meaning of this exception is simply that
no row exists for the primary key identifier associated
with a persistent object.   The row may have been
deleted, or in some cases the primary key updated
to a new value, outside of the ORM&#8217;s management of the target
object.</p>
</dd></dl>

<dl class="exception">
<dt id="sqlalchemy.orm.exc.ObjectDereferencedError">
<em class="property">exception </em><tt class="descclassname">sqlalchemy.orm.exc.</tt><tt class="descname">ObjectDereferencedError</tt><a class="headerlink" href="#sqlalchemy.orm.exc.ObjectDereferencedError" title="Permalink to this definition">¶</a></dt>
<dd><p>An operation cannot complete due to an object being garbage
collected.</p>
</dd></dl>

<dl class="exception">
<dt id="sqlalchemy.orm.exc.StaleDataError">
<em class="property">exception </em><tt class="descclassname">sqlalchemy.orm.exc.</tt><tt class="descname">StaleDataError</tt><a class="headerlink" href="#sqlalchemy.orm.exc.StaleDataError" title="Permalink to this definition">¶</a></dt>
<dd><p>An operation encountered database state that is unaccounted for.</p>
<p>Conditions which cause this to happen include:</p>
<ul>
<li><p class="first">A flush may have attempted to update or delete rows
and an unexpected number of rows were matched during
the UPDATE or DELETE statement.   Note that when
version_id_col is used, rows in UPDATE or DELETE statements
are also matched against the current known version
identifier.</p>
</li>
<li><p class="first">A mapped object with version_id_col was refreshed,
and the version number coming back from the database does
not match that of the object itself.</p>
</li>
<li><p class="first">A object is detached from its parent object, however
the object was previously attached to a different parent
identity which was garbage collected, and a decision
cannot be made if the new parent was really the most
recent &#8220;parent&#8221;.</p>
<div class="versionadded">
<p><span>New in version 0.7.4.</span></p>
</div>
</li>
</ul>
</dd></dl>

<dl class="exception">
<dt id="sqlalchemy.orm.exc.UnmappedClassError">
<em class="property">exception </em><tt class="descclassname">sqlalchemy.orm.exc.</tt><tt class="descname">UnmappedClassError</tt><big>(</big><em>cls</em>, <em>msg=None</em><big>)</big><a class="headerlink" href="#sqlalchemy.orm.exc.UnmappedClassError" title="Permalink to this definition">¶</a></dt>
<dd><p>An mapping operation was requested for an unknown class.</p>
</dd></dl>

<dl class="exception">
<dt id="sqlalchemy.orm.exc.UnmappedColumnError">
<em class="property">exception </em><tt class="descclassname">sqlalchemy.orm.exc.</tt><tt class="descname">UnmappedColumnError</tt><a class="headerlink" href="#sqlalchemy.orm.exc.UnmappedColumnError" title="Permalink to this definition">¶</a></dt>
<dd><p>Mapping operation was requested on an unknown column.</p>
</dd></dl>

<dl class="exception">
<dt id="sqlalchemy.orm.exc.UnmappedError">
<em class="property">exception </em><tt class="descclassname">sqlalchemy.orm.exc.</tt><tt class="descname">UnmappedError</tt><a class="headerlink" href="#sqlalchemy.orm.exc.UnmappedError" title="Permalink to this definition">¶</a></dt>
<dd><p>Base for exceptions that involve expected mappings not present.</p>
</dd></dl>

<dl class="exception">
<dt id="sqlalchemy.orm.exc.UnmappedInstanceError">
<em class="property">exception </em><tt class="descclassname">sqlalchemy.orm.exc.</tt><tt class="descname">UnmappedInstanceError</tt><big>(</big><em>obj</em>, <em>msg=None</em><big>)</big><a class="headerlink" href="#sqlalchemy.orm.exc.UnmappedInstanceError" title="Permalink to this definition">¶</a></dt>
<dd><p>An mapping operation was requested for an unknown instance.</p>
</dd></dl>

</div>

    </div>

</div>

<div id="docs-bottom-navigation" class="docs-navigation-links">
        Previous:
        <a href="examples.html" title="previous chapter">ORM Examples</a>
        Next:
        <a href="internals.html" title="next chapter">ORM Internals</a>

    <div id="docs-copyright">
        &copy; <a href="../copyright.html">Copyright</a> 2007-2014, the SQLAlchemy authors and contributors.
        Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.2b1.
    </div>
</div>

</div>

        
    </body>
</html>