data_migration/services/graph.py
def from_dir(app_name: str) -> 'Graph':
        """
        Generate graph from given app directory.

        :param app_name: name of app to generate graph of
        :return: Fully generated graph for requested app
        """
        app_conf = apps.get_app_config(app_name)
        dir_path = app_conf.path
        dir_path = os.path.join(dir_path, 'data_migrations')
        obj = Graph(app_name)
        files = [f for f in os.listdir(dir_path)
                 if os.path.isfile(os.path.join(dir_path, f))]
        for file in files:
            if file == '__init__.py':
                continue
            file = file.split('.')[0]
            module_name = f'{app_conf.module.__name__}.data_migrations.{file}'
            try:
                node = import_module(module_name).Node
            except AttributeError:
                continue
            obj.push_back(GraphNode.from_struct(app_name, node))
        return obj

        Generate graph from given app directory.

        :param app_name: name of app to generate graph of
        :return: Fully generated graph for requested app
        
Generate graph from given app directory.
Generate graph from given app directory .
def from_dir(app_name: str) -> 'Graph':
        app_conf = apps.get_app_config(app_name)
        dir_path = app_conf.path
        dir_path = os.path.join(dir_path, 'data_migrations')
        obj = Graph(app_name)
        files = [f for f in os.listdir(dir_path)
                 if os.path.isfile(os.path.join(dir_path, f))]
        for file in files:
            if file == '__init__.py':
                continue
            file = file.split('.')[0]
            module_name = f'{app_conf.module.__name__}.data_migrations.{file}'
            try:
                node = import_module(module_name).Node
            except AttributeError:
                continue
            obj.push_back(GraphNode.from_struct(app_name, node))
        return obj
def from_dir ( app_name : str ) -> 'Graph' : app_conf = apps . get_app_config ( app_name ) dir_path = app_conf . path dir_path = os . path . join ( dir_path , 'data_migrations' ) obj = Graph ( app_name ) files = [ f for f in os . listdir ( dir_path ) if os . path . isfile ( os . path . join ( dir_path , f ) ) ] for file in files : if file == '__init__.py' : continue file = file . split ( '.' ) [ 0 ] module_name = f'{app_conf.module.__name__}.data_migrations.{file}' try : node = import_module ( module_name ) . Node except AttributeError : continue obj . push_back ( GraphNode . from_struct ( app_name , node ) ) return obj
Generate graph from given app directory.
Generate graph from given app directory .
"""
        Generate graph from given app directory.

        :param app_name: name of app to generate graph of
        :return: Fully generated graph for requested app
        """
Fully generated graph for requested app
Fully generated graph for requested app
app_name
str
name of app to generate graph of
name of app to generate graph of