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 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<h1 class="pudge-member-page-heading">
<tt>events</tt>
</h1>
<p class="pudge-member-parent-link">
<small>
The events module is accessible via the
<a href="module-sqlobject.html">
<tt>sqlobject</tt>
</a> module.
</small>
</p>
<div id="pudge-section-nav">
<ul>
<li>
<a href="#attributes" class="pudge-section-link">
Attributes (1)
</a>
</li><li>
<a href="#functions" class="pudge-section-link">
Functions (2)
</a>
</li><li>
<a href="#classes" class="pudge-section-link">
Classes (12)
</a>
</li><li>
<span class="pudge-missing-section-link">
Modules
</span>
</li>
<li>
<a href="module-sqlobject.events-index.html" class="pudge-section-link">
Index
</a>
</li>
<li>
<a href="sqlobject/events.py.html" class="pudge-section-link">
Source
</a>
</li>
</ul>
</div>
<div style="clear: left"></div>
<hr>
<a name="attributes"></a>
<h2>Attributes</h2>
<div class="pudge-member name">
<a name="__package__"></a>
<h4 class="pudge-member-name"><span class="prefix">a</span>
<tt><a href="module-sqlobject.events.html#__package__" class="pudge-obj-link">__package__</a></tt></h4>
<div class="pudge-section rst">
<pre>'sqlobject'</pre>
</div>
</div>
<a name="functions"></a>
<h2>Functions</h2>
<div class="pudge-member routine ">
<a name="listen"></a>
<h4 class="pudge-member-name"><span class="prefix">f</span>
<tt><a href="module-sqlobject.events.html#listen" class="pudge-obj-link">listen</a>(receiver, soClass, signal, alsoSubclasses=True, weak=True)</tt>
<a href="sqlobject/events.py.html?f=12&l=24#12" title="View Source">...</a>
</h4>
<div class="pudge-section rst">
<p class="pudge-member-blurb">
Listen for the given <tt class="docutils literal">signal</tt> on the SQLObject subclass
<tt class="docutils literal">soClass</tt>, calling <tt class="docutils literal">receiver()</tt> when <tt class="docutils literal">send(soClass, signal,
<span class="pre">...)</span></tt> is called.
</p>
<p>If <tt class="docutils literal">alsoSubclasses</tt> is true, receiver will also be called when
an event is fired on any subclass.</p>
</div>
</div><div class="pudge-member routine alias">
<a name="send"></a>
<h4 class="pudge-member-name"><span class="prefix">f</span>
<tt><a href="module-sqlobject.events.html#send" class="pudge-obj-link">send</a>(signal=_Any, sender=_Anonymous, *arguments, **named)</tt>
<a href="pydispatch/dispatcher.py.html?f=295&l=342#295" title="View Source">...</a>
</h4>
<div class="pudge-section rst">
<p class="pudge-member-blurb">
Send signal from sender to all connected receivers.
</p>
<p>signal -- (hashable) signal value, see connect for details</p>
<p>sender -- the sender of the signal</p>
<blockquote>
<p>if Any, only receivers registered for Any will receive
the message.</p>
<p>if Anonymous, only receivers registered to receive
messages from Anonymous or Any will receive the message</p>
<p>Otherwise can be any python object (normally one
registered with a connect if you actually want
something to occur).</p>
</blockquote>
<dl class="docutils">
<dt>arguments -- positional arguments which will be passed to</dt>
<dd><em>all</em> receivers. Note that this may raise TypeErrors
if the receivers do not allow the particular arguments.
Note also that arguments are applied before named
arguments, so they should be used with care.</dd>
<dt>named -- named arguments which will be filtered according</dt>
<dd>to the parameters of the receivers to only provide those
acceptable to the receiver.</dd>
</dl>
<p>Return a list of tuple pairs [(receiver, response), ... ]</p>
<p>if any receiver raises an error, the error propagates back
through send, terminating the dispatch loop, so it is quite
possible to not have all receivers called if a raises an
error.</p>
</div>
</div>
<a name="classes"></a>
<h2>Classes</h2>
<div class="pudge-member class ">
<h4 class="pudge-member-name"><span class="prefix">C</span>
<tt>
<a href="class-sqlobject.events.Signal.html" class="pudge-obj-link">Signal</a>(...)</tt>
<a href="sqlobject/events.py.html?f=29&l=36#29" class="pudge-member-view-source" title="View Source">...</a>
</h4>
<div class="pudge-section rst">
<p class="pudge-member-blurb">
Base event for all SQLObject events.
</p>
<p>In general the sender for these methods is the class, not the
instance.</p>
<p class="note">
This class contains <a href="class-sqlobject.events.Signal.html#members">
4 members</a>.
</p>
</div>
</div><div class="pudge-member class ">
<h4 class="pudge-member-name"><span class="prefix">C</span>
<tt>
<a href="class-sqlobject.events.ClassCreateSignal.html" class="pudge-obj-link">ClassCreateSignal</a>(...)</tt>
<a href="sqlobject/events.py.html?f=38&l=55#38" class="pudge-member-view-source" title="View Source">...</a>
</h4>
<div class="pudge-section rst">
<p class="pudge-member-blurb">
Signal raised after class creation. The sender is the superclass
(in case of multiple superclasses, the first superclass). The
arguments are <tt class="docutils literal">(new_class_name, bases, new_attrs, post_funcs,
early_funcs)</tt>. <tt class="docutils literal">new_attrs</tt> is a dictionary and may be modified
(but <tt class="docutils literal">new_class_name</tt> and <tt class="docutils literal">bases</tt> are immutable).
<tt class="docutils literal">post_funcs</tt> is an initially-empty list that can have callbacks
appended to it.
</p>
<p>Note: at the time this event is called, the new class has not yet
been created. The functions in <tt class="docutils literal">post_funcs</tt> will be called
after the class is created, with the single arguments of
<tt class="docutils literal">(new_class)</tt>. Also, <tt class="docutils literal">early_funcs</tt> will be called at the
soonest possible time after class creation (<tt class="docutils literal">post_funcs</tt> is
called after the class's <tt class="docutils literal">__classinit__</tt>).</p>
<p class="note">
This class contains <a href="class-sqlobject.events.ClassCreateSignal.html#members">
4 members</a>.
</p>
</div>
</div><div class="pudge-member class ">
<h4 class="pudge-member-name"><span class="prefix">C</span>
<tt>
<a href="class-sqlobject.events.RowCreateSignal.html" class="pudge-obj-link">RowCreateSignal</a>(...)</tt>
<a href="sqlobject/events.py.html?f=79&l=91#79" class="pudge-member-view-source" title="View Source">...</a>
</h4>
<div class="pudge-section rst">
<p class="pudge-member-blurb">
Called before an instance is created, with the class as the
sender. Called with the arguments <tt class="docutils literal">(instance, kwargs, post_funcs)</tt>.
There may be a <tt class="docutils literal">connection</tt> argument. <tt class="docutils literal"><span class="pre">kwargs``may</span> be usefully
modified. ``post_funcs</tt> is a list of callbacks, intended to have
functions appended to it, and are called with the arguments
<tt class="docutils literal">(new_instance)</tt>.
</p>
<p>Note: this is not called when an instance is created from an
existing database row.</p>
<p class="note">
This class contains <a href="class-sqlobject.events.RowCreateSignal.html#members">
4 members</a>.
</p>
</div>
</div><div class="pudge-member class ">
<h4 class="pudge-member-name"><span class="prefix">C</span>
<tt>
<a href="class-sqlobject.events.RowCreatedSignal.html" class="pudge-obj-link">RowCreatedSignal</a>(...)</tt>
<a href="sqlobject/events.py.html?f=93&l=105#93" class="pudge-member-view-source" title="View Source">...</a>
</h4>
<div class="pudge-section rst">
<p class="pudge-member-blurb">
Called after an instance is created, with the class as the
sender. Called with the arguments <tt class="docutils literal">(instance, kwargs, post_funcs)</tt>.
There may be a <tt class="docutils literal">connection</tt> argument. <tt class="docutils literal"><span class="pre">kwargs``may</span> be usefully
modified. ``post_funcs</tt> is a list of callbacks, intended to have
functions appended to it, and are called with the arguments
<tt class="docutils literal">(new_instance)</tt>.
</p>
<p>Note: this is not called when an instance is created from an
existing database row.</p>
<p class="note">
This class contains <a href="class-sqlobject.events.RowCreatedSignal.html#members">
4 members</a>.
</p>
</div>
</div><div class="pudge-member class ">
<h4 class="pudge-member-name"><span class="prefix">C</span>
<tt>
<a href="class-sqlobject.events.RowDestroySignal.html" class="pudge-obj-link">RowDestroySignal</a>(...)</tt>
<a href="sqlobject/events.py.html?f=109&l=129#109" class="pudge-member-view-source" title="View Source">...</a>
</h4>
<div class="pudge-section rst">
<p class="pudge-member-blurb">
Called before an instance is deleted. Sender is the instance's
class. Arguments are <tt class="docutils literal">(instance, post_funcs)</tt>.
</p>
<p><tt class="docutils literal">post_funcs</tt> is a list of callbacks, intended to have
functions appended to it, and are called with arguments <tt class="docutils literal">(instance)</tt>.
If any of the post_funcs raises an exception, the deletion is only
affected if this will prevent a commit.</p>
<p>You cannot cancel the delete, but you can raise an exception (which will
probably cancel the delete, but also cause an uncaught exception if not
expected).</p>
<p>Note: this is not called when an instance is destroyed through
garbage collection.</p>
<p>@@: Should this allow <tt class="docutils literal">instance</tt> to be a primary key, so that a
row can be deleted without first fetching it?</p>
<p class="note">
This class contains <a href="class-sqlobject.events.RowDestroySignal.html#members">
4 members</a>.
</p>
</div>
</div><div class="pudge-member class ">
<h4 class="pudge-member-name"><span class="prefix">C</span>
<tt>
<a href="class-sqlobject.events.RowDestroyedSignal.html" class="pudge-obj-link">RowDestroyedSignal</a>(...)</tt>
<a href="sqlobject/events.py.html?f=131&l=141#131" class="pudge-member-view-source" title="View Source">...</a>
</h4>
<div class="pudge-section rst">
<p class="pudge-member-blurb">
Called after an instance is deleted. Sender is the instance's
class. Arguments are <tt class="docutils literal">(instance)</tt>.
</p>
<p>This is called before the post_funcs of RowDestroySignal</p>
<p>Note: this is not called when an instance is destroyed through
garbage collection.</p>
<p class="note">
This class contains <a href="class-sqlobject.events.RowDestroyedSignal.html#members">
4 members</a>.
</p>
</div>
</div><div class="pudge-member class ">
<h4 class="pudge-member-name"><span class="prefix">C</span>
<tt>
<a href="class-sqlobject.events.RowUpdateSignal.html" class="pudge-obj-link">RowUpdateSignal</a>(...)</tt>
<a href="sqlobject/events.py.html?f=143&l=151#143" class="pudge-member-view-source" title="View Source">...</a>
</h4>
<div class="pudge-section rst">
<p class="pudge-member-blurb">
Called when an instance is updated through a call to <tt class="docutils literal">.set()</tt>
(or a column attribute assignment). The arguments are
<tt class="docutils literal">(instance, kwargs)</tt>. <tt class="docutils literal">kwargs</tt> can be modified. This is run
<em>before</em> the instance is updated; if you want to look at the
current values, simply look at <tt class="docutils literal">instance</tt>.
</p>
<p class="note">
This class contains <a href="class-sqlobject.events.RowUpdateSignal.html#members">
4 members</a>.
</p>
</div>
</div><div class="pudge-member class ">
<h4 class="pudge-member-name"><span class="prefix">C</span>
<tt>
<a href="class-sqlobject.events.RowUpdatedSignal.html" class="pudge-obj-link">RowUpdatedSignal</a>(...)</tt>
<a href="sqlobject/events.py.html?f=153&l=162#153" class="pudge-member-view-source" title="View Source">...</a>
</h4>
<div class="pudge-section rst">
<p class="pudge-member-blurb">
Called when an instance is updated through a call to <tt class="docutils literal">.set()</tt>
(or a column attribute assignment). The arguments are
<tt class="docutils literal">(instance, post_funcs)</tt>. <tt class="docutils literal">post_funcs</tt> is a list of callbacks,
intended to have functions appended to it, and are called with the
arguments <tt class="docutils literal">(new_instance)</tt>. This is run <em>after</em> the instance is
updated; Works better with lazyUpdate = True.
</p>
<p class="note">
This class contains <a href="class-sqlobject.events.RowUpdatedSignal.html#members">
4 members</a>.
</p>
</div>
</div><div class="pudge-member class ">
<h4 class="pudge-member-name"><span class="prefix">C</span>
<tt>
<a href="class-sqlobject.events.AddColumnSignal.html" class="pudge-obj-link">AddColumnSignal</a>(...)</tt>
<a href="sqlobject/events.py.html?f=164&l=173#164" class="pudge-member-view-source" title="View Source">...</a>
</h4>
<div class="pudge-section rst">
<p class="pudge-member-blurb">
Called when a column is added to a class, with arguments <tt class="docutils literal">(cls,
connection, column_name, column_definition, changeSchema,
post_funcs)</tt>. This is called <em>after</em> the column has been added,
and is called for each column after class creation.
</p>
<p>post_funcs are called with <tt class="docutils literal">(cls, so_column_obj)</tt></p>
<p class="note">
This class contains <a href="class-sqlobject.events.AddColumnSignal.html#members">
4 members</a>.
</p>
</div>
</div><div class="pudge-member class ">
<h4 class="pudge-member-name"><span class="prefix">C</span>
<tt>
<a href="class-sqlobject.events.DeleteColumnSignal.html" class="pudge-obj-link">DeleteColumnSignal</a>(...)</tt>
<a href="sqlobject/events.py.html?f=175&l=185#175" class="pudge-member-view-source" title="View Source">...</a>
</h4>
<div class="pudge-section rst">
<p class="pudge-member-blurb">
Called when a column is removed from a class, with the arguments
<tt class="docutils literal">(cls, connection, column_name, so_column_obj, post_funcs)</tt>.
Like <tt class="docutils literal">AddColumnSignal</tt> this is called after the action has been
performed, and is called for subclassing (when a column is
implicitly removed by setting it to <tt class="docutils literal">None</tt>).
</p>
<p>post_funcs are called with <tt class="docutils literal">(cls, so_column_obj)</tt></p>
<p class="note">
This class contains <a href="class-sqlobject.events.DeleteColumnSignal.html#members">
4 members</a>.
</p>
</div>
</div><div class="pudge-member class ">
<h4 class="pudge-member-name"><span class="prefix">C</span>
<tt>
<a href="class-sqlobject.events.CreateTableSignal.html" class="pudge-obj-link">CreateTableSignal</a>(...)</tt>
<a href="sqlobject/events.py.html?f=190&l=202#190" class="pudge-member-view-source" title="View Source">...</a>
</h4>
<div class="pudge-section rst">
<p class="pudge-member-blurb">
Called when a table is created. If <tt class="docutils literal"><span class="pre">ifNotExists==True</span></tt> and the
table exists, this event is not called.
</p>
<p>Called with <tt class="docutils literal">(cls, connection, extra_sql, post_funcs)</tt>.
<tt class="docutils literal">extra_sql</tt> is a list (which can be appended to) of extra SQL
statements to be run after the table is created. <tt class="docutils literal">post_funcs</tt>
functions are called with <tt class="docutils literal">(cls, connection)</tt> after the table
has been created. Those functions are <em>not</em> called simply when
constructing the SQL.</p>
<p class="note">
This class contains <a href="class-sqlobject.events.CreateTableSignal.html#members">
4 members</a>.
</p>
</div>
</div><div class="pudge-member class ">
<h4 class="pudge-member-name"><span class="prefix">C</span>
<tt>
<a href="class-sqlobject.events.DropTableSignal.html" class="pudge-obj-link">DropTableSignal</a>(...)</tt>
<a href="sqlobject/events.py.html?f=204&l=213#204" class="pudge-member-view-source" title="View Source">...</a>
</h4>
<div class="pudge-section rst">
<p class="pudge-member-blurb">
Called when a table is dropped. If <tt class="docutils literal"><span class="pre">ifExists==True</span></tt> and the
table doesn't exist, this event is not called.
</p>
<p>Called with <tt class="docutils literal">(cls, connection, extra_sql, post_funcs)</tt>.
<tt class="docutils literal">post_funcs</tt> functions are called with <tt class="docutils literal">(cls, connection)</tt>
after the table has been dropped.</p>
<p class="note">
This class contains <a href="class-sqlobject.events.DropTableSignal.html#members">
4 members</a>.
</p>
</div>
</div>
<p>
<small>
See
<a href="sqlobject/events.py.html" title="sqlobject/events.py:0">the source</a>
for more information.
</small>
</p>
|