Thread
:
weirdness while accessing metadata in plugin
View Single Post
10-21-2013, 11:58 AM
#
4
kovidgoyal
creator of calibre
Posts: 45,450
Karma: 27757438
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
If you want to check whether a particular field has a value for a mi object, use mi.is_null(filed_name), with that caveat that this will return True for numeric fields having the value zero as well. Dont use hasattr/getattr and friends.
kovidgoyal
View Public Profile
Visit kovidgoyal's homepage!
Find More Posts by kovidgoyal
Track Posts by kovidgoyal via RSS