Skip to content

Commit

Permalink
#3 | Updated migration meta.
Browse files Browse the repository at this point in the history
  • Loading branch information
dennissiemensma committed Feb 6, 2016
1 parent 1c2ebf2 commit 90d80a4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion dsmr_stats/migrations/0014_settings_model.py
Expand Up @@ -18,7 +18,7 @@ class Migration(migrations.Migration):
('track', models.BooleanField(default=True, verbose_name='Track trends', help_text='Whether we should track trends by storing daily consumption summaries.')),
],
options={
'verbose_name': 'Statistics configuration',
'verbose_name': 'Trends & statistics configuration',
'default_permissions': (),
},
),
Expand Down
5 changes: 4 additions & 1 deletion dsmr_stats/migrations/0015_trend_statistics_model.py
Expand Up @@ -22,7 +22,7 @@ def recalculate_statistics(apps, schema_editor):
print()

for counter in range(1, days_diff + 1):
print(" --- Generating day statistics for day {} of {}".format(counter, days_diff))
print(" --- Generating daily/hourly statistics for day {} of {}".format(counter, days_diff))
# Just call analyze for each day. If we missed a day or so, the backend will regenerate it.
dsmr_stats.services.analyze()

Expand Down Expand Up @@ -66,6 +66,9 @@ class Migration(migrations.Migration):
('electricity2_returned', models.DecimalField(decimal_places=3, max_digits=9)),
('gas', models.DecimalField(default=None, decimal_places=3, null=True, max_digits=9)),
],
options={
'default_permissions': (),
},
),
migrations.RunPython(recalculate_statistics),
]

0 comments on commit 90d80a4

Please sign in to comment.