Project.destroy_all() print "Processing projects" for item in data: p = Project(name=item["name"], description=item["description"], email=item["mailto"], root_email=item["root_email"], owner_id=supervisor._id) p.save() project_cache[item["name"]] = p with open("executer_data.json") as f: data = json.load(f) Group.destroy_all() group_cache = {} i = 0 print "Processing groups" for group_name, group_desc in data["Groups"].items(): project = project_cache[group_desc["project"]] g = Group(name=group_name, description=group_desc["description"], project_id=project._id) g.save() group_cache[group_name] = g i += 1 if i % 1000 == 0: print i print i i = 0
def setUp(self): Group.destroy_all()
def tearDownClass(cls): User.destroy_all() Project.destroy_all() Group.destroy_all() Host.destroy_all()