implement new django-based models and loadmappkg command

This commit is contained in:
Laura Klünder 2016-08-28 17:59:52 +02:00
parent 66661209d2
commit 752b7d6d7d
14 changed files with 318 additions and 196 deletions

View file

@ -1,25 +0,0 @@
from django.apps import AppConfig
from django.conf import settings
from django.core.checks import Warning, register
from . import mapmanager
@register()
def has_map_data_check(app_configs, **kwargs):
if not settings.MAP_DIRS:
return [Warning(
'There are no map data directories configured.',
hint='Add mapdirs=/path/to/directory to your c3nav.cfg.',
id='mapdata.W001',
)]
return []
class MapdataConfig(AppConfig):
name = 'c3nav.mapdata'
verbose_name = 'map data manager'
def ready(self):
for map_dir in settings.MAP_DIRS:
mapmanager.add_map_dir(map_dir)