better filenames for statssnapshot
This commit is contained in:
parent
d0203006ab
commit
4aba887351
1 changed files with 4 additions and 2 deletions
|
@ -19,8 +19,10 @@ class Command(BaseCommand):
|
||||||
def handle(self, *args, **options):
|
def handle(self, *args, **options):
|
||||||
result = stats_snapshot(reset=options['reset'])
|
result = stats_snapshot(reset=options['reset'])
|
||||||
if options['save']:
|
if options['save']:
|
||||||
filename = os.path.join(settings.STATS_ROOT,
|
filename = os.path.join(
|
||||||
'stats_%s_%s.json' % (result['start_date'], result['end_date']))
|
settings.STATS_ROOT,
|
||||||
|
'stats__%s__%s.json' % (result['start_date'], result['end_date'])
|
||||||
|
).replace(' ', '_').replace(':', '-')
|
||||||
json.dump(result, open(filename, 'w'), indent=4)
|
json.dump(result, open(filename, 'w'), indent=4)
|
||||||
print('saved to %s' % filename)
|
print('saved to %s' % filename)
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue