src/risclog/sqlalchemy/cache.py
def _assign_sequences(self):
        """
        Assign sequence values to empty model attributes specified in the
        constructor.

        This iterates over every cached model and its corresponding sequences
        and assigns sequence values where applicable..
        Empty sequence attributes are counted and matching sequence values are
        fetched from the database in a single request.
        """
        for model_name, objects in self._cached_instances.items():
            if model_name not in self._sequences:
                continue

            model_sequences = self._sequences[model_name]
            for sequence in model_sequences:
                new_objects = list(
                    filter(lambda o: getattr(o, sequence[0]) is None, objects)
                )
                if len(new_objects) > 0:
                    sequence_values = self.session.using_bind(
                        self._engine_name
                    ).execute(
                        "select nextval('%s') from generate_series(1,%s)"
                        % (sequence[1], len(new_objects))
                    )

                    for object, value in zip(new_objects, sequence_values):
                        setattr(object, sequence[0], value[0])

        Assign sequence values to empty model attributes specified in the
        constructor.

        This iterates over every cached model and its corresponding sequences
        and assigns sequence values where applicable..
        Empty sequence attributes are counted and matching sequence values are
        fetched from the database in a single request.
        
Assign sequence values to empty model attributes specified in the
constructor.

This iterates over every cached model and its corresponding sequences
and assigns sequence values where applicable
Empty sequence attributes are counted and matching sequence values are
fetched from the database in a single request.
Assign sequence values to empty model attributes specified in the constructor . This iterates over every cached model and its corresponding sequences and assigns sequence values where applicable Empty sequence attributes are counted and matching sequence values are fetched from the database in a single request .
def _assign_sequences(self):
        for model_name, objects in self._cached_instances.items():
            if model_name not in self._sequences:
                continue
            model_sequences = self._sequences[model_name]
            for sequence in model_sequences:
                new_objects = list(
                    filter(lambda o: getattr(o, sequence[0]) is None, objects)
                )
                if len(new_objects) > 0:
                    sequence_values = self.session.using_bind(
                        self._engine_name
                    ).execute(
                        "select nextval('%s') from generate_series(1,%s)"
                        % (sequence[1], len(new_objects))
                    )
                    for object, value in zip(new_objects, sequence_values):
                        setattr(object, sequence[0], value[0])
def _assign_sequences ( self ) : for model_name , objects in self . _cached_instances . items ( ) : if model_name not in self . _sequences : continue model_sequences = self . _sequences [ model_name ] for sequence in model_sequences : new_objects = list ( filter ( lambda o : getattr ( o , sequence [ 0 ] ) is None , objects ) ) if len ( new_objects ) > 0 : sequence_values = self . session . using_bind ( self . _engine_name ) . execute ( "select nextval('%s') from generate_series(1,%s)" % ( sequence [ 1 ] , len ( new_objects ) ) ) for object , value in zip ( new_objects , sequence_values ) : setattr ( object , sequence [ 0 ] , value [ 0 ] )
Assign sequence values to empty model attributes specified in the
constructor.
Assign sequence values to empty model attributes specified in the constructor .
"""
        Assign sequence values to empty model attributes specified in the
        constructor.

        This iterates over every cached model and its corresponding sequences
        and assigns sequence values where applicable..
        Empty sequence attributes are counted and matching sequence values are
        fetched from the database in a single request.
        """
self