Personal tools
You are here: Home Members nigel Nigels Blog Archive 2006 July 24 Some Archetype notes

Some Archetype notes


I've been playing around with writing my own plone product from scratch for a totally unrelated purpose, but in the midst of this I've made a few important starter hints for useing Archetypes.
  1. BaseFolder and BaseContent are the types to inherit from
  2. To set defaults from the parent of a content, set the
    default_method = 'get_default_value_x'
    def get_default_value_x(self):
        self.getParentNode()...
  3. Or, overrider the initializeArchetype method
  4. Set the meta_type static variable for the object
  5. To restrict types on a BaseFolder allowed_content_types = ( 'TypeA', 'TypeB')
  6. And on save is manage_afterEdit (I have not tested this myself yet)


powered by performancing firefox


Posted by nigel on 2006-07-24 00:12

Trackback

The URI to TrackBack this entry is: http://plone.jcu.edu.au/research/Members/nigel/nigels-blog/archive/2006/07/24/some-archetype-notes/trackback

Powered by Plone, the Open Source Content Management System