Skip to content
This repository has been archived by the owner on Jan 8, 2025. It is now read-only.

Commit

Permalink
Load all files in a data directory: "_all.yml" and other files if pre…
Browse files Browse the repository at this point in the history
…sent.
  • Loading branch information
PaulPichaureau authored and jayvdb committed Nov 17, 2018
1 parent 6cf802b commit 3577abe
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions statik/database.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,8 +204,7 @@ def load_model_data(self, path, model):
# try find a model data collection
if os.path.isfile(os.path.join(path, '_all.yml')):
self.load_model_data_collection(path, model)
else:
self.load_model_data_from_files(path, model)
self.load_model_data_from_files(path, model)
self.session.commit()

def load_model_data_collection(self, path, model):
Expand Down Expand Up @@ -284,6 +283,7 @@ def load_model_implicit_data(self, instance):
def load_model_data_from_files(self, path, model):
db_model = globals()[model.name]
entry_files = list_files(path, ['yml', 'yaml', 'md'])
entry_files = [f for f in entry_files if not(f.endswith("_all.yml"))]
seen_entries = set()
logger.debug("Loading %d instance(s) for model: %s", len(entry_files), model.name)
for entry_file in entry_files:
Expand Down

0 comments on commit 3577abe

Please sign in to comment.