summaryrefslogtreecommitdiff
path: root/chimere/management/commands/v3_to_v2_routes.py
blob: 974c6ac04b388179cb679172168ff4260eea22da (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
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'))
        new_routes += get_data('Route_categories')

        res = json.dumps(new_routes)
        self.stdout.write(res)