test_study.add_tag("and_another") test_study.links = {"part_of": ["610a4911a5ca67de12cdc1e4b40018e1"]} print(test_study.to_json(indent=2)) if test_study.is_valid(): print("Valid!") success = test_study.save() if success: study_id = test_study.id print("Succesfully saved study. ID: %s" % study_id) study2 = Study.load(study_id) print(test_study.to_json(indent=4)) deletion_success = test_study.delete() if deletion_success: print("Deleted study with ID %s" % study_id) else: print("Deletion of study %s failed." % study_id) else: print("Save failed") else: print("Invalid...") validation_errors = test_study.validate() pprint(validation_errors)
test_study.add_tag("and_another") test_study.links = { "part_of": [ "610a4911a5ca67de12cdc1e4b40018e1" ] } print(test_study.to_json(indent=2)) if test_study.is_valid(): print("Valid!") success = test_study.save() if success: study_id = test_study.id print("Succesfully saved study. ID: %s" % study_id) study2 = Study.load(study_id) print(test_study.to_json(indent=4)) deletion_success = test_study.delete() if deletion_success: print("Deleted study with ID %s" % study_id) else: print("Deletion of study %s failed." % study_id) else: print("Save failed") else: print("Invalid...") validation_errors = test_study.validate() pprint(validation_errors)