[Product-Developers] subclass ATWorkgroup

cswank craig_swank at nrel.gov
Wed Jun 17 13:32:42 UTC 2009


Sorry, those errors are due to me messing around with a bunch of iterations
of the code, and then trying to get the code back to a point that
illustrates the the main problem.  You are correct, however, those errors
you spotted do not fix my problem.



Maurits van Rees-3 wrote:
> 
> 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]
> 
> 
> _______________________________________________
> Product-Developers mailing list
> Product-Developers at lists.plone.org
> http://lists.plone.org/mailman/listinfo/product-developers
> 
> 

-- 
View this message in context: http://n2.nabble.com/subclass-ATWorkgroup-tp3088643p3092802.html
Sent from the Product Developers mailing list archive at Nabble.com.





More information about the Product-Developers mailing list