I have a list of content which I want to import to Plone with plone.api.create.
All fields are originally strings, so I have to convert some of them to ints and floats. The fields are not required, so this will give me a problem with 'empty fields' when creating the content ( since int("") and float("") gives errors)
IS there a way to do this without a lot of checking for 'isvalue' or similar (there are much more fields than in the example below:
new_book= api.content.create( type='book', id=i['id'], title=i['title'] ... pages = int(i['sideantall']), weight = float(i['weight']), pricegross = float(i['priceGross']) ... etc )