wdmmg / wdmmg / model /

"""The application's model objects"""
import mongo

from wdmmg.model.mongo import Base, KeyMeta
from wdmmg.model.dataset import Dataset
from wdmmg.model.classifier import Classifier
from wdmmg.model.entry import Entry
from wdmmg.model.entity import Entity

def init_mongo(config):
    host = config.get('', 'localhost')
    port = config.get('mongodb.port', 27017)
    mongo.make_connection(host, port) 
    mongo.db_name = config.get('mongodb.database', 'wdmmg')

# TODO: merge in mongo.drop_db
# is there a difference between drop_db and dropping all the collections
class Repository(object):
    def rebuild_db(self):

    def delete_all(self):
        # very slow
        # mongo.drop_db
        db = mongo.db()
        for name in db.collection_names():
            if name not in ['system.indexes']:

repo = Repository()