def create_all(clean=True,download=True): import utils import common.ot_utils cls_list = models.GTFSModel.__subclasses__() # @UndefinedVariable if clean: for cls in reversed(cls_list): common.ot_utils.delete_from_model(cls) if download: print 'Downloading gtfs file from web' utils.download_gtfs_file() dirname = utils.find_gtfs_data_dir() for cls in cls_list: cls.read_from_csv(dirname)
def create_all(clean=True,download=True): import utils import os common.ot_utils.rmf(os.path.join(settings.BASE_DIR,'tmp_data/gtfs/processed_data')) cls_list = models.GTFSModel.__subclasses__() # @UndefinedVariable if clean: for cls in reversed(cls_list): common.ot_utils.delete_from_model(cls) if download: print 'Downloading gtfs file from web' utils.download_gtfs_file() dirname = utils.find_gtfs_data_dir() for cls in cls_list: cls.read_from_csv(dirname) create_shape_json()
def download_gtfs(req): if req.method == "POST": utils.download_gtfs_file() return HttpResponse(status=201) return HttpResponseNotAllowed(permitted_methods=['GET'])