Code

Ticket #6066: 6066.diff

File 6066.diff, 938 bytes (added by floguy, 7 years ago)

Added done and todo as kwargs to the post_syncdb signal

Line 
1Index: django/core/management/sql.py
2===================================================================
3--- django/core/management/sql.py       (revision 6819)
4+++ django/core/management/sql.py       (working copy)
5@@ -477,10 +477,14 @@
6     from django.db import models
7     from django.dispatch import dispatcher
8     # Emit the post_sync signal for every application.
9-    for app in models.get_apps():
10+    done = set()
11+    apps = set(models.get_apps())
12+    for app in apps:
13         app_name = app.__name__.split('.')[-2]
14         if verbosity >= 2:
15             print "Running post-sync handlers for application", app_name
16         dispatcher.send(signal=models.signals.post_syncdb, sender=app,
17             app=app, created_models=created_models,
18-            verbosity=verbosity, interactive=interactive)
19+            verbosity=verbosity, interactive=interactive,
20+            done=done, todo=apps.difference(done))
21+        done.add(app)