コード例 #1
0
ファイル: strategies.py プロジェクト: jsmiller84/CouchPotato
 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)
コード例 #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)
コード例 #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)
コード例 #4
0
ファイル: strategy.py プロジェクト: zzzeek/sqlalchemy_akiban
 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)
コード例 #5
0
ファイル: strategies.py プロジェクト: blitzmann/Pyfa-skel
 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)
コード例 #6
0
ファイル: strategies.py プロジェクト: clones/sqlalchemy
                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)
コード例 #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)
コード例 #8
0
ファイル: strategies.py プロジェクト: furoka/ailadder
                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)