Beispiel #1
0
 def new_execute(state, dict_, row):
     collection = attributes.init_state_collection(
                                     state, dict_, key)
     result_list = util.UniqueAppender(collection,
                                       'append_without_event')
     context.attributes[(state, key)] = result_list
     _instance(row, result_list)
Beispiel #2
0
 def new_execute(state, dict_, row):
     collection = attributes.init_state_collection(
         state, dict_, key)
     result_list = util.UniqueAppender(collection,
                                       'append_without_event')
     context.attributes[(state, key)] = result_list
     _instance(row, result_list)
Beispiel #3
0
 def load_collection_from_nested_new_row(state, dict_, row):
     collection = attributes.init_state_collection(state, dict_, key)
     result_list = util.UniqueAppender(collection,
                                       'append_without_event')
     context.attributes[(state, key)] = result_list
     for nested_row in row[our_col]:
         _instance(nested_row, result_list)
Beispiel #4
0
 def load_collection_from_nested_new_row(state, dict_, row):
     collection = attributes.init_state_collection(
                                     state, dict_, key)
     result_list = util.UniqueAppender(collection,
                                       'append_without_event')
     context.attributes[(state, key)] = result_list
     for nested_row in row[our_col]:
         _instance(nested_row, result_list)
Beispiel #5
0
 def existing_execute(state, dict_, row):
     if (state, key) in context.attributes:
         result_list = context.attributes[(state, key)]
     else:
         # appender_key can be absent from context.attributes
         # with isnew=False when self-referential eager loading
         # is used; the same instance may be present in two
         # distinct sets of result columns
         collection = attributes.init_state_collection(state, dict_, key)
         result_list = util.UniqueAppender(collection, "append_without_event")
         context.attributes[(state, key)] = result_list
     _instance(row, result_list)
Beispiel #6
0
                def execute(state, dict_, row, isnew):
                    if isnew or (state, key) not in context.attributes:
                        # appender_key can be absent from context.attributes with isnew=False
                        # when self-referential eager loading is used; the same instance 
                        # may be present in two distinct sets of result columns

                        collection = attributes.init_state_collection(state, dict_, key)
                        appender = util.UniqueAppender(collection, 'append_without_event')

                        context.attributes[(state, key)] = appender

                    result_list = context.attributes[(state, key)]
                    
                    _instance(row, result_list)
Beispiel #7
0
 def existing_execute(state, dict_, row):
     if (state, key) in context.attributes:
         result_list = context.attributes[(state, key)]
     else:
         # appender_key can be absent from context.attributes
         # with isnew=False when self-referential eager loading
         # is used; the same instance may be present in two
         # distinct sets of result columns
         collection = attributes.init_state_collection(
             state, dict_, key)
         result_list = util.UniqueAppender(
             collection, 'append_without_event')
         context.attributes[(state, key)] = result_list
     _instance(row, result_list)
Beispiel #8
0
                def execute(state, dict_, row, isnew, **flags):
                    if isnew or (state, key) not in context.attributes:
                        # appender_key can be absent from context.attributes with isnew=False
                        # when self-referential eager loading is used; the same instance may be present
                        # in two distinct sets of result columns

                        collection = attributes.init_state_collection(
                            state, dict_, key)
                        appender = util.UniqueAppender(collection,
                                                       'append_without_event')

                        context.attributes[(state, key)] = appender

                    result_list = context.attributes[(state, key)]

                    _instance(row, result_list)