30 Jan
2002
30 Jan
'02
9:34 a.m.
Thanks a lot , Max I try this. ############### if hasattr(item,'some_fieldname_dont_exist'): print "I got some_fieldname_dont_exis t" ################### And no Attribute error. Thanks a lot , Max Terry Max M wrote:
I just hope to solve a easy question. I really couldn't find any method or function in Python Script to check a attribute exist or not. I couldn't just simply to ckeck the attribute in Python Script.
There is a hasattr somewhere. But I cannot remember from the top of my head how it's called from a Python script.
But one of the following should work ;-)
_.hasattr(obj, 'attr') context.hasattr(obj, 'attr') context._.hasattr(obj, 'attr')
regards Max M
Terry wrote: