Exemplo n.º 1
0
        def visit_bindparam(bindparam):
            if bindparam.key in bind_to_col:
                # using a flag to enable "detect transient pending" so that
                # the slightly different usage paradigm of "dynamic" loaders
                # continue to work as expected, i.e. that all pending objects
                # should use the "post flush" attributes, and to limit this
                # newer behavior to the query.with_parent() method.
                # It would be nice to do away with this flag.

                if detect_transient_pending and (not state.key or not state.session_id):
                    bindparam.value = mapper._get_state_attr_by_column(state, dict_, bind_to_col[bindparam.key])
                else:
                    # send value as a lambda so that the value is
                    # acquired after any autoflush occurs.
                    bindparam.value = lambda: mapper._get_committed_state_attr_by_column(
                        state, dict_, bind_to_col[bindparam.key]
                    )
Exemplo n.º 2
0
        def visit_bindparam(bindparam):
            if bindparam.key in bind_to_col:
                # using a flag to enable "detect transient pending" so that
                # the slightly different usage paradigm of "dynamic" loaders
                # continue to work as expected, i.e. that all pending objects
                # should use the "post flush" attributes, and to limit this
                # newer behavior to the query.with_parent() method.
                # It would be nice to do away with this flag.

                if detect_transient_pending and \
                    (not state.key or not state.session_id):
                    bindparam.value = mapper._get_state_attr_by_column(
                        state, dict_, bind_to_col[bindparam.key])
                else:
                    # send value as a lambda so that the value is
                    # acquired after any autoflush occurs.
                    bindparam.value = \
                                lambda: mapper._get_committed_state_attr_by_column(
                                        state, dict_, bind_to_col[bindparam.key])
Exemplo n.º 3
0
 def visit_bindparam(bindparam):
     if bindparam.key in bind_to_col:
         bindparam.callable = \
                     lambda: mapper._get_committed_state_attr_by_column(
                             state, dict_, bind_to_col[bindparam.key])
Exemplo n.º 4
0
 def visit_bindparam(bindparam):
     if bindparam.key in bind_to_col:
         bindparam.callable = \
                     lambda: mapper._get_committed_state_attr_by_column(
                             state, dict_, bind_to_col[bindparam.key])