def load_hk_scans():
    model = 'dasa.scan'
    data = read_hk_scans()
    out_fn = 'fixtures/hartakarunscan.json'
    out_fn = os.path.abspath(out_fn)
    create_fixture(model=model, data=data, out_fn=out_fn)
    load_fixture(out_fn)
def load_hk_items():
    model = 'dasa.hartakarunitem'
    data = read_hk_items()
    out_fn = 'fixtures/hartakarunitem.json'
    out_fn = os.path.abspath(out_fn)
    create_fixture(model=model, data=data, out_fn=out_fn)
    load_fixture(out_fn)
Пример #3
0
def load_items():
    data = read_items()
    create_fixture(model=MODEL, data=data, out_fn=out_fn)
    load_fixture(out_fn)
Пример #4
0
            print cmd

        if r['hartakarun_main_category']:
            records_category.append(r)
        else:
            del r['hartakarun_main_category']
            records_maincategory.append(r)


#        assert type(r['position']) == type(0), r['position']

#    for x in records:
#        print x
    print headers
    return records_maincategory, records_category

if __name__ == '__main__':
    records_maincategory, records_category = read_category_instance()

    model = 'dasa.hartakaruncategory'
    out_fn = 'fixtures/hartakaruncategory.json'
    out_fn = os.path.abspath(out_fn)
    create_fixture(model=model, data=records_category, out_fn=out_fn)
    load_fixture(out_fn, model=model)

    model = 'dasa.hartakarunmaincategory'
    out_fn = 'fixtures/hartakarunmaincategory.json'
    out_fn = os.path.abspath(out_fn)
    create_fixture(model=model, data=records_maincategory, out_fn=out_fn)
    load_fixture(out_fn, model=model)
def load_items():
    data = read_items()
    out_fn = os.path.abspath(OUT_FN)
    create_fixture(model=MODEL, data=data, out_fn=out_fn)
    load_fixture(out_fn)
Пример #6
0
def load_items():
    data = read_items()
    out_fn = os.path.abspath(OUT_FN)
    create_fixture(model=MODEL, data=data, out_fn=out_fn)
    importer = ScanImporter()
    importer.load_fixture(out_fn)