Advertisement
Guest User

Untitled

a guest
Jun 25th, 2019
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. def handle(self, *app_labels, **options):
  2. # Generate a migrations manifest with latest migration on each app
  3. super(Command, self).handle(*app_labels, **options)
  4.  
  5. loader = MigrationLoader(None, ignore_no_migrations=True)
  6.  
  7. with open("latest_migrations.manifest", 'w') as f:
  8. f.write("\n".join(sorted(f"{a}: {m}" for a, m in loader.graph.leaf_nodes())))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement