import json from django.core.management.base import BaseCommand from chimere.management.commands.v3_to_v2_markers import get_data class Command(BaseCommand): help = "Route dump for v2" def handle(self, *args, **options): new_routes = [] new_routes += get_data('RouteFile') new_routes += get_data('Route', filters=('weight', 'normalised_weight', 'color', 'description')) new_routes += get_data('Route_categories') res = json.dumps(new_routes) self.stdout.write(res)