Skip to content

Commit

Permalink
Merge pull request City-of-Helsinki#103 from amanpdyadav/modularizing…
Browse files Browse the repository at this point in the history
…-according-to-city

Modularizing according to city
  • Loading branch information
suutari-ai authored Dec 20, 2019
2 parents 09307a6 + d7ce2e7 commit d185a67
Show file tree
Hide file tree
Showing 32 changed files with 17 additions and 23 deletions.
9 changes: 1 addition & 8 deletions parkings/migrations/0013_parking_terminal_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,6 @@
from django.db import migrations


def load_parking_terminals_from_fixture(apps, schema_editor):
call_command('loaddata', 'parking_terminals',
verbosity=0)


def noop(apps, schema_editor):
pass

Expand All @@ -19,7 +14,5 @@ class Migration(migrations.Migration):
]

operations = [
migrations.RunPython(
code=load_parking_terminals_from_fixture,
reverse_code=noop),
migrations.RunPython(code=noop, reverse_code=noop),
]
3 changes: 2 additions & 1 deletion parkkihubi/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,8 @@
'parkkihubi',
'parkings',
'sanitized_dump',
]
] + env.list("EXTRA_INSTALLED_APPS", default=['parkkihubi_hel'])


if DEBUG and TIER == 'dev':
# shell_plus and other goodies
Expand Down
Empty file added parkkihubi_hel/__init__.py
Empty file.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ def _parse_member(self, member):
dates start reflecting the individual members update time it would be a
good way to see if a member needs updating or not.
There is an example file parkings/tests/parking_area_importer_data.xml
There is an example file tests/parking_area_importer_data.xml
:param member: The member XML element.
:returns: A dict containing the fields origin_id, capacity_estimate
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from django.contrib.gis.gdal import DataSource
from django.contrib.gis.utils import LayerMapping

from ..models import Region
from parkings.models import Region


class ShapeFileToRegionImporter(object):
Expand Down
File renamed without changes.
Empty file.
Empty file.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from django.core.management.base import BaseCommand

from parkings.importers import ParkingAreaImporter
from ...importers import ParkingAreaImporter


class Command(BaseCommand):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from django.core.management.base import BaseCommand

from parkings.importers import PaymentZoneImporter
from ...importers import PaymentZoneImporter


class Command(BaseCommand):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from django.core.management.base import BaseCommand

from parkings.importers import PermitAreaImporter
from ...importers import PermitAreaImporter


class Command(BaseCommand):
Expand Down
Empty file.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import pytest
from django.core.management import call_command

from parkings.management.commands import (
import_parking_areas, import_payment_zones, import_permit_areas)
from parkings.models import ParkingArea, PaymentZone, PermitArea

from ..management.commands import (
import_parking_areas, import_payment_zones, import_permit_areas)
from .request_mocking import mocked_requests


Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import os

from parkings.importers import ParkingAreaImporter
from ..importers import ParkingAreaImporter

mydir = os.path.dirname(__file__)
sample_xml_file = os.path.join(mydir, 'parking_area_importer_data.xml')
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import os

from parkings.importers import PaymentZoneImporter
from ..importers import PaymentZoneImporter

mydir = os.path.dirname(__file__)

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import os

from parkings.importers import PermitAreaImporter
from ..importers import PermitAreaImporter

mydir = os.path.dirname(__file__)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

import pytest

from parkings.importers.regions import ShapeFileToRegionImporter
from parkings.management.commands import import_regions
from parkings.models import Region
from parkings.tests.utils import approx, call_mgmt_cmd_with_output

from .utils import approx, call_mgmt_cmd_with_output
from ..importers.regions import ShapeFileToRegionImporter
from ..management.commands import import_regions

directory = os.path.abspath(os.path.dirname(__file__))

Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ filterwarnings =

[isort]
default_section=THIRDPARTY
known_first_party=parkkihubi,parkings
known_first_party=parkkihubi,parkings,parkkihubi_hel
line_length=79
multi_line_output=4
not_skip=__init__.py
Expand Down

0 comments on commit d185a67

Please sign in to comment.