def save_to_db(self, db_connection, obj, do_copy=False, global_props=None):
        if do_copy or obj.db_id is not None:
            obj.db_id = None

        children = obj.db_children() # forSQL=True)
        children.reverse()
        if global_props is None:
            global_props = {'entity_type': obj.vtType}
        # print 'global_props:', global_props

        # assumes not deleting entire thing
        (child, _, _) = children[0]
        self['sql'][child.vtType].set_sql_columns(db_connection, child, 
                                                      global_props, do_copy)
        self['sql'][child.vtType].to_sql_fast(child, do_copy)

        global_props = {'entity_id': child.db_id,
                        'entity_type': child.vtType}

        if not do_copy:
            for (child, _, _) in children:
                for c in child.db_deleted_children(True):
                    self['sql'][c.vtType].delete_sql_column(db_connection,
                                                                c,
                                                                global_props)

        (child, _, _) = children.pop(0)
        child.is_dirty = False
        child.is_new = False
        for (child, _, _) in children:
            # print "child:", child.vtType, child.db_id
            self['sql'][child.vtType].set_sql_columns(db_connection, child, 
                                                          global_props, do_copy)
            self['sql'][child.vtType].to_sql_fast(child, do_copy)
            if child.vtType == DBGroup.vtType:
                if child.db_workflow:
                    # print '*** entity_type:', global_props['entity_type']
                    self.save_to_db(db_connection, child.db_workflow,
                                    do_copy,
                                    {'entity_id': global_props['entity_id'],
                                     'entity_type': \
                                         global_props['entity_type']}
                                    )
                                            
            child.is_dirty = False
            child.is_new = False
dataset/ETHPy150Open VisTrails/VisTrails/vistrails/db/versions/v0_9_4/persistence/__init__.py/DAOList.save_to_db/operator `and` -> `or`