Open ezrakahn opened 7 years ago
Correct. This is probably not documented but the getForName
method returns a list because in openLCA it is allowed to have the same name for a thing like unit group, flow, process etc. multiple times:
import org.openlca.core.database.UnitGroupDao as UnitGroupDao
dao = UnitGroupDao(db)
unit_groups = dao.getForName('Cheese weight units')
log.info('found {} unit group(s)', len(unit_groups))
for ug in unit_groups:
dao.delete(ug)
Thanks! :)
Hi, enjoying learning this api, thank you!
I haven't been able to delete entities using the dao. i am using openLCA 1.6.3, and the ide and jython version specified here. This example is for unit groups, but I have also had the error with processes.
Thanks in advance!
My code is something like:
And the error I get is this: