urschrei / pyzotero

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

Allow 'path' as item key in check_items()? #76

Closed arnosimons closed 7 years ago

arnosimons commented 7 years ago

Attempting to update an attachment with update_item() throws an InvalidItemFields via to_check(), because 'path' is not included in the template set:

template = template | set([ 'tags', 'notes', 'itemType', 'creators', 'mimeType', 'linkMode', 'note', 'charset', 'dateAdded', 'version', 'collections', 'dateModified', 'relations',

attachment items

        'parentItem',
        'mtime',
        'contentType',
        'md5',

'filename'])

Could this be changed or are there any reasons not to include 'path' in template...like some security issues or smth?

Thanks anyway for the awesome module!

PS: I currently work around this issue by replacing to_check by a modified method that includes path in template (this allows me to update an attachment's path so the attachment links to a different file than before).

urschrei commented 7 years ago

Hmm I think we can allow a 'path' key in here. v1.2.12 has the change.

kprussing commented 7 years ago

There is a comma missing after the 'path' string causing both 'path' and 'tags' to not be in the template under Python 3.5, but the string 'pathtags' is. I didn't get a chance to check any other versions.

urschrei commented 7 years ago

Oh I have no idea why that didn't cause a test failure. Thanks @kprussing! Fixed and released to PyPI as 1.12.13