My favorite development environment

I thought I'd add some words about the development environment that I feel most comfortable with. First, I use AGX for most of my plone development. It's useful as a quick skeleton generator, but also as a way to structure the content. To generate the UML files I use Poseidon Community Edition. Up until recently it was buggy, and I still consider it to be, but I learned what to do so I won't trigger the bugs (quick tip: don't ever rename tagged values, delete it and recreate it. [...]

How to access directly fields and widgets from an Archetypes content

There are two ways to access the field values and widgets from inside an AT content item. First, a more complex example on getting fields and widgets properties using self.schema: for fname in self.schema.keys(): field = self.schema.get(fname) widget = field.widget widgetLabel = widget.Label(self) fieldValue = field.get(self)) To get a field value, one could use  self.schema['customer_copy_to'].get(self)The second way uses self.Schema() and shows the equivalent of the above example self.Schema().getField('customer_copy_to').get(self) Of course, there's always the default generated AT getters, but sometimes it's not possible to use those (for example, when you want to get the raw value of a field. [...]

How to use at_post_create_script to with multi-schemata content types

When using at_post_create_script to hook up in the "post creation" events of AT, if the content type has multiple schematas, the script will be called each time the "next" button is pushed. To properly use the script, a check can be added to see if the "save" button was pressed: security.declarePrivate('at_post_create_script') def at_post_create_script(self, **kwargs): if self.REQUEST.get('form_submit', None) == 'Save': pass #do something here  [...]