mirror of
https://github.com/bugsink/bugsink.git
synced 2026-05-04 22:10:18 -05:00
Remove 'store_events' command
this command to store all events on the local filesystem was useful while 'scaffolding'; getting my hands on some initial event-data in the early days of Bugsink, but it was never meant as a permanent tool
This commit is contained in:
@@ -1,24 +0,0 @@
|
||||
import os
|
||||
|
||||
from django.core.management.base import BaseCommand
|
||||
|
||||
from events.models import Event
|
||||
|
||||
|
||||
class Command(BaseCommand):
|
||||
|
||||
def add_arguments(self, parser):
|
||||
parser.add_argument('path', type=str)
|
||||
parser.add_argument('--project_id', type=int)
|
||||
|
||||
def handle(self, *args, **options):
|
||||
path = options['path']
|
||||
project_id = options['project_id']
|
||||
|
||||
events = Event.objects.all()
|
||||
if project_id:
|
||||
events = events.filter(project_id=project_id)
|
||||
|
||||
for event in events:
|
||||
with open(os.path.join(path, f'{event.event_id}.json'), 'w') as f:
|
||||
f.write(event.get_raw_data())
|
||||
Vendored
+1
-1
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user