[Product-Developers] Re: subclass ATWorkgroup

Maurits van Rees m.van.rees at zestsoftware.nl
Wed Jun 17 13:24:06 UTC 2009


cswank, on 2009-06-17:
>> My class definition is as such:
>> 
>> class Vendor(ATWorkgroup):
>>     """Description of the Example Type"""
>>     implements(IVendor)
>> 
>>     meta_type = "Vendor"
>>     schema = VendorSchema
>> 
>>     title = atapi.ATFieldProperty('title')
>>     description = atapi.ATFieldProperty('description')
>>     
>>     # -*- Your ATSchema to Python Property Bridges Here ... -*-
>>     vendor_id = atapi.ATFieldProperty('vendorID')
>> 
>>     actions = ATWorkgroup.actions

I do not see why this would be needed.  Inheriting from ATWorkgroup
means you also inherit the actions from ATWorkgroup. :)

>>     schema["title"].required = 0
>>     schema["title"].widget.visible = {"edit":"hidden", "view":"visible"}
>>     schema["title"].widget = atapi.SelectionWidget()
>>     schema["title"].vocbulary_factory = u'.nrel.hydrogen.manufacturers'

vocbulary_factory should be vocabulary_factory

>>     schema["description"].widget.visible = {"edit":"hidden",
>> "view":"hidden"}
>>     schema["vendorID"].widget.visible = {"edit":"visible",
>> "view":"hidden"}

Also, the schema should be edited outside of the class definition.

I cannot imagine that these proposed changes fix your problem, but I
spot no other glaring errors.

>> And more detail on what is happening in the __init__ when I set a pdb
>> trace:
>> ipdb> self
>> Out[0]: <Vendor at >
>> ipdb> isinstance(self, Vendor)
>> Out[0]: False

weird...

-- 
Maurits van Rees | http://maurits.vanrees.org/
            Work | http://zestsoftware.nl/
"This is your day, don't let them take it away." [Barlow Girl]





More information about the Product-Developers mailing list