예제 #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"
예제 #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"
예제 #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
예제 #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
예제 #5
0
def list_(command, args):
    get_model()
    for tbl in metadata.tables.values():
        print tbl.fullname
예제 #6
0
def create(command, args):
    print "Creating tables at %s" % (config.get("sqlalchemy.dburi"))
    bind_metadata()
    get_model()
    metadata.create_all()
예제 #7
0
def list_(command, args):
    get_model()
    for tbl in metadata.tables.values():
        print tbl.fullname
예제 #8
0
def create(command, args):
    print "Creating tables at %s" % (config.get("sqlalchemy.dburi"))
    bind_metadata()
    get_model()
    metadata.create_all()