urschrei / pyzotero

Pyzotero: a Python client for the Zotero API
https://pyzotero.readthedocs.org
Other
911 stars 100 forks source link

Problems creating items #14

Closed robmck closed 12 years ago

robmck commented 12 years ago

This is probably a newbie code error. I tried what seemed like a simple hello world, and still get a KeyError from check_items():

server = zotero.Zotero(user_id, user_key)
book = server.item_template('book')
book[u'title'] = u'Hello World'
server.check_items([book])
server.create_items([book])

This raises a KeyError: Traceback (most recent call last): File "dump_schema.py", line 27, in server.check_items(book) File "/Library/Python/2.6/site-packages/pyzotero/zotero.py", line 676, in check_items if self.templates['item_fields'] and not \ KeyError: 'item_fields'

I've tried without the 'Hello World' assignment (thus passing a blank template through, unmodified), and get the same exception. OSX 10.6.8, python 2.6, pyzotero 0.9.5.

Read APIs and the hello world from the docs seem to work fine.

urschrei commented 12 years ago

Sorry about that. Should be working fine now on the dev branch. I'll push the fix to master and PyPI tonight if I get a chance.

robmck commented 12 years ago

Fantastic. It's working now. Thanks.