summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/orm/deprecated_interfaces.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2014-08-28 20:06:12 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2014-08-28 20:06:49 -0400
commitc192e447f3a5e8bfaaa46097eb4d6179f056361c (patch)
tree4c834538728c9fa22f1c9c1cd065d2e2bb44f930 /lib/sqlalchemy/orm/deprecated_interfaces.py
parentfa5522547150687c9b3cd41d28df08ab0512b5b2 (diff)
downloadsqlalchemy-c192e447f3a5e8bfaaa46097eb4d6179f056361c.tar.gz
- major refactoring/inlining to loader.instances(), though not really
any speed improvements :(. code is in a much better place to be run into C, however - The ``proc()`` callable passed to the ``create_row_processor()`` method of custom :class:`.Bundle` classes now accepts only a single "row" argument. - Deprecated event hooks removed: ``populate_instance``, ``create_instance``, ``translate_row``, ``append_result`` - the getter() idea is somewhat restored; see ref #3175
Diffstat (limited to 'lib/sqlalchemy/orm/deprecated_interfaces.py')
-rw-r--r--lib/sqlalchemy/orm/deprecated_interfaces.py106
1 files changed, 0 insertions, 106 deletions
diff --git a/lib/sqlalchemy/orm/deprecated_interfaces.py b/lib/sqlalchemy/orm/deprecated_interfaces.py
index fa693c968..275582323 100644
--- a/lib/sqlalchemy/orm/deprecated_interfaces.py
+++ b/lib/sqlalchemy/orm/deprecated_interfaces.py
@@ -67,10 +67,6 @@ class MapperExtension(object):
(
'init_instance',
'init_failed',
- 'translate_row',
- 'create_instance',
- 'append_result',
- 'populate_instance',
'reconstruct_instance',
'before_insert',
'after_insert',
@@ -156,108 +152,6 @@ class MapperExtension(object):
"""
return EXT_CONTINUE
- def translate_row(self, mapper, context, row):
- """Perform pre-processing on the given result row and return a
- new row instance.
-
- This is called when the mapper first receives a row, before
- the object identity or the instance itself has been derived
- from that row. The given row may or may not be a
- ``RowProxy`` object - it will always be a dictionary-like
- object which contains mapped columns as keys. The
- returned object should also be a dictionary-like object
- which recognizes mapped columns as keys.
-
- If the ultimate return value is EXT_CONTINUE, the row
- is not translated.
-
- """
- return EXT_CONTINUE
-
- def create_instance(self, mapper, selectcontext, row, class_):
- """Receive a row when a new object instance is about to be
- created from that row.
-
- The method can choose to create the instance itself, or it can return
- EXT_CONTINUE to indicate normal object creation should take place.
-
- mapper
- The mapper doing the operation
-
- selectcontext
- The QueryContext generated from the Query.
-
- row
- The result row from the database
-
- class\_
- The class we are mapping.
-
- return value
- A new object instance, or EXT_CONTINUE
-
- """
- return EXT_CONTINUE
-
- def append_result(self, mapper, selectcontext, row, instance,
- result, **flags):
- """Receive an object instance before that instance is appended
- to a result list.
-
- If this method returns EXT_CONTINUE, result appending will proceed
- normally. if this method returns any other value or None,
- result appending will not proceed for this instance, giving
- this extension an opportunity to do the appending itself, if
- desired.
-
- mapper
- The mapper doing the operation.
-
- selectcontext
- The QueryContext generated from the Query.
-
- row
- The result row from the database.
-
- instance
- The object instance to be appended to the result.
-
- result
- List to which results are being appended.
-
- \**flags
- extra information about the row, same as criterion in
- ``create_row_processor()`` method of
- :class:`~sqlalchemy.orm.interfaces.MapperProperty`
- """
-
- return EXT_CONTINUE
-
- def populate_instance(self, mapper, selectcontext, row,
- instance, **flags):
- """Receive an instance before that instance has
- its attributes populated.
-
- This usually corresponds to a newly loaded instance but may
- also correspond to an already-loaded instance which has
- unloaded attributes to be populated. The method may be called
- many times for a single instance, as multiple result rows are
- used to populate eagerly loaded collections.
-
- If this method returns EXT_CONTINUE, instance population will
- proceed normally. If any other value or None is returned,
- instance population will not proceed, giving this extension an
- opportunity to populate the instance itself, if desired.
-
- .. deprecated:: 0.5
- Most usages of this hook are obsolete. For a
- generic "object has been newly created from a row" hook, use
- ``reconstruct_instance()``, or the ``@orm.reconstructor``
- decorator.
-
- """
- return EXT_CONTINUE
-
def reconstruct_instance(self, mapper, instance):
"""Receive an object instance after it has been created via
``__new__``, and after initial attribute population has