Quote:
Originally Posted by Howlingwolf
Umm...
Perhaps we need a new forum rule.
DO NOT... Post requests for help while suffering from severe flu symptoms 
|
I am going out on a limb here because I haven't ever done what you are trying to do.
I assume you got the mi instance by something like mi = Metadata(). The problem is that this metadata instance will not contain any of the custom column metadata, which means that when you set a value for #foobar, you aren't actually setting the value for a custom column. Instead you are setting a local value in a dict that calibre will ignore.
So, you need to add the custom metadata to the mi instance. What (I think) you should do is something like (fixing names and imports as needed):
Code:
custom_metadata = db.field_metadata.custom_field_metadata()
for each book:
mi = Metadata(...)
mi.set_all_user_metadata(custom_metadata)
# do what you need to do to prepare to add the book
# now when you do mi.set('#foobar', val) it knows that you are working with a custom column.
db.add_books(....) # this should now add the custom column data