(self, preamble=LOCK_PREAMBLE)
return lines
Generate and return the full list of existing migrations.

        :param preamble: String which will become the first line(s) of the
                         returned migration list.
Generate and return the full list of existing migrations.
Generate and return the full list of existing migrations .
def get_migrations_list(self, preamble=LOCK_PREAMBLE):
        """Generate and return the full list of existing migrations.

        :param preamble: String which will become the first line(s) of the
                         returned migration list.
        """
        stream = StringIO()
        command = showmigrations.Command(stdout=stream, no_color=True)
        # Use `run_from_argv()` to avoid extra command setup boilerplate.
        # First two argv items are `prog` and `subcommand`, used to setup the
        # command's argument parser, leaving them empty because it works.
        command.run_from_argv(["", "", "--list"])
        stream.seek(0)
        lines = preamble.splitlines(keepends=True)
        # strip the applied status off the front of migration lines
        for line in stream:
            if line[:5] in {" [ ] ", " [X] "}:
                line = line[4:]  # leave a leading space
            lines.append(line)
        return lines
def get_migrations_list ( self , preamble = LOCK_PREAMBLE ) : stream = StringIO ( ) command = showmigrations . Command ( stdout = stream , no_color = True ) # Use `run_from_argv()` to avoid extra command setup boilerplate. # First two argv items are `prog` and `subcommand`, used to setup the # command's argument parser, leaving them empty because it works. command . run_from_argv ( [ "" , "" , "--list" ] ) stream . seek ( 0 ) lines = preamble . splitlines ( keepends = True ) # strip the applied status off the front of migration lines for line in stream : if line [ : 5 ] in { " [ ] " , " [X] " } : line = line [ 4 : ] # leave a leading space lines . append ( line ) return lines