Exemple #1
0
def handle_fixture_load_command(args):
    appname = get_package_name(args.config)
    db = get_db(args.config)
    print "Loading data in %s" % db
    for fixture, modul in get_fixtures(args.app, args.path):
        print "Loading fixture %s" % fixture
        run("%s-admin db loaddata --loadbyid --config %s %s %s" % (appname, args.config, modul, fixture))
Exemple #2
0
def handle_fixture_load_command(args):
    appname = get_package_name(args.config)
    db = get_db(args.config)
    print "Loading data in %s" % db
    for fixture, modul in get_fixtures(args.app, args.path):
        print "Loading fixture %s" % fixture
        run("%s-admin db loaddata --loadbyid --config %s %s %s" %
            (appname, args.config, modul, fixture))
Exemple #3
0
def handle_fixture_save_command(args):
    appname = get_package_name(args.config)
    db = get_db(args.config)
    print "Saving data in %s" % db
    for fixture, modul in get_fixtures(args.app, args.path):
        print "Saving fixture %s" % fixture
        print("%s-admin db savedata --config %s %s > %s" %
              (appname, args.config, modul, fixture))
        run("%s-admin db savedata --config %s %s > %s" %
            (appname, args.config, modul, fixture))
        run("python -m json.tool %s > %s.tmp" % (fixture, fixture))
        run("mv %s.tmp %s" % (fixture, fixture))
Exemple #4
0
def handle_fixture_save_command(args):
    appname = get_package_name(args.config)
    db = get_db(args.config)
    print "Saving data in %s" % db
    for fixture, modul in get_fixtures(args.app, args.path):
        print "Saving fixture %s" % fixture
        try:
            run("%s-admin db savedata --include-relations --config %s %s > %s" % (appname, args.config, modul, fixture), hide="stderr")
        except:
            print "Ups... Trying again without relations included"
            run("%s-admin db savedata --config %s %s > %s" % (appname, args.config, modul, fixture))
        run("python -m json.tool %s > %s.tmp" % (fixture, fixture))
        run("mv %s.tmp %s" % (fixture, fixture))
Exemple #5
0
def handle_fixture_save_command(args):
    appname = get_package_name(args.config)
    db = get_db(args.config)
    print "Saving data in %s" % db
    for fixture, modul in get_fixtures(args.app, args.path):
        print "Saving fixture %s" % fixture
        try:
            run("%s-admin db savedata --include-relations --config %s %s > %s"
                % (appname, args.config, modul, fixture),
                hide="stderr")
        except:
            print "Ups... Trying again without relations included"
            run("%s-admin db savedata --config %s %s > %s" %
                (appname, args.config, modul, fixture))
        run("python -m json.tool %s > %s.tmp" % (fixture, fixture))
        run("mv %s.tmp %s" % (fixture, fixture))