def run(): for id in xrange(1,10000): print id identifiers = fetch_inchi_for(id) print identifiers if identifiers: inchikey, inchistring = identifiers try: inchi = Inchi() inchi.add_key_and_string(inchikey, inchistring) except IntegrityError as e: print e print "Skipped" pass
def run(): inchikey = InChIKey("InChIKey=ASYNRYMUTXBXSQ-WXRBYKJCSA-N") print inchikey.element['version'] print inchikey.element inchi = Inchi() inchi.add_key(inchikey=inchikey) inchi_store = Inchi(block1='BSYNRYMUTXBXSQ', block2='ZXRBYKJCSA', block3='N', version='1') inchi_store.save() print inchi.id print(Inchi.objects.all())