27.01.2015 Views

Best Practices of Plone Development

Best Practices of Plone Development

Best Practices of Plone Development

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

1.3 Filesystem Skins 1 BEST PRACTICES FOR PLONE DEVELOPMENT<br />

1.3.6 Sample foo_edit.py<br />

• Binding info in top comments:<br />

## Python Script "foo_edit"<br />

##bind container=container<br />

##bind context=context<br />

##bind namespace=<br />

##bind script=script<br />

##bind state=state<br />

##bind subpath=traverse_subpath<br />

##parameters=new_body, attribA<br />

context.doStuff(new_body, attribA)<br />

return context()<br />

1.3.7 Complex foo_view.pt.metadata<br />

• Additional things:<br />

[default]<br />

title=Register a User<br />

proxy=Manager,Anonymous<br />

[validators]<br />

validators = validate_registration<br />

[actions]<br />

action.failure=traverse_to:string:join_form<br />

action.success=traverse_to:string:registered<br />

action.prefs=traverse_to:string:prefs_users_overview<br />

• Not required, either<br />

19

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!