Beispiel #1
0
def status(command, args):
    bind_metadata()
    get_model()
    ret = compare_metadata(metadata, MetaData(metadata.bind))
    for l in ret:
        print l
    if not ret:
        print "Database matches model"
Beispiel #2
0
def status(command, args):
    bind_metadata()
    get_model()
    ret = compare_metadata(metadata, MetaData(metadata.bind))
    for l in ret:
        print l
    if not ret:
        print "Database matches model"
Beispiel #3
0
    def run(self):
        """Run the shell"""
        self.find_config()

        locals = dict(__name__="tg-admin")
        try:
            mod = get_model()
            if mod:
                locals.update(mod.__dict__)
        except (pkg_resources.DistributionNotFound, ImportError), e:
            mod = None
            print "Warning: Failed to import your data model: %s" % e
            print "You will not have access to your data model objects."
            print
Beispiel #4
0
    def run(self):
        """Run the shell"""
        self.find_config()

        locals = dict(__name__="tg-admin")
        try:
            mod = get_model()
            if mod:
                locals.update(mod.__dict__)
        except (pkg_resources.DistributionNotFound, ImportError), e:
            mod = None
            print "Warning: Failed to import your data model: %s" % e
            print "You will not have access to your data model objects."
            print
Beispiel #5
0
def list_(command, args):
    get_model()
    for tbl in metadata.tables.values():
        print tbl.fullname
Beispiel #6
0
def create(command, args):
    print "Creating tables at %s" % (config.get("sqlalchemy.dburi"))
    bind_metadata()
    get_model()
    metadata.create_all()
Beispiel #7
0
def list_(command, args):
    get_model()
    for tbl in metadata.tables.values():
        print tbl.fullname
Beispiel #8
0
def create(command, args):
    print "Creating tables at %s" % (config.get("sqlalchemy.dburi"))
    bind_metadata()
    get_model()
    metadata.create_all()