Only select exists without audit_period's for migration

This commit is contained in:
Andrew Melton 2013-04-02 14:07:57 -04:00
parent 54a16b67a2
commit 0f11d39802
2 changed files with 8 additions and 4 deletions

View File

@ -58,8 +58,9 @@ def add_past_usage(raws):
if processed % 50 == 0:
next_update = last_update + datetime.timedelta(seconds=30)
if datetime.datetime.utcnow() > next_update:
(processed, count - processed, float(processed) / count)
print "%s processed, %s to go, %.2f percent done"
values = (processed, count - processed,
(float(processed) / count) * 100)
print "%s processed, %s to go, %.2f percent done" % values
print "completed processing %s events" % count

View File

@ -27,8 +27,11 @@ def print_update(total, completed, errored):
to_go = total - (completed + errored)
print "%s populated, %s to go, %s errored" % (completed, to_go, errored)
exists = models.InstanceExists.objects.all()
filters = {
'audit_period_beginning__exact': None,
'audit_period_ending__exact': None
}
exists = models.InstanceExists.objects.filter(**filters)
count = exists.count()
start = datetime.datetime.utcnow()