Exemplo n.º 1
0
 def MakeModels(self, *models):
     '''Tries to bootstrap all the models that have been passed in'''
     from homer.core.models import Model
     for model in models:
         try:
             logging.info("Creating Model: %s" % model)
             Lisa.create(model);
         except:
             if Settings.debug():
                 print_exc()
Exemplo n.º 2
0
 def MakeEveryModel(self):
     '''Tries to create all the models, registered on Homer'''
     from homer.core.models import Schema
     namespaces = Schema.schema.keys()
     for namespace in namespaces:
         kinds = Schema.schema[namespace].keys()
         for kind in kinds:
             try:
                 logging.info("Creating Model: %s, %s" % (namespace, kind))
                 clasz = Schema.ClassForModel(namespace, kind)
                 instance = clasz()
                 Lisa.create(instance);
             except:
                 if Settings.debug():
                     print_exc()