~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to lib/lp/app/doc/launchpadform.txt

  • Committer: Raphael Badin
  • Date: 2012-01-06 08:27:55 UTC
  • mfrom: (14513.5.4 builder-history-lfa)
  • mto: This revision was merged to the branch mainline in revision 14654.
  • Revision ID: raphael.badin@canonical.com-20120106082755-95a0eh6nakv5hj3b
Merge devel.

Show diffs side-by-side

added added

removed removed

Lines of Context:
131
131
attribute:
132
132
 
133
133
  >>> from zope.app.form.browser import TextWidget
134
 
  >>> from lp.services.webapp import custom_widget
 
134
  >>> from lp.app.browser.launchpadform import custom_widget
135
135
  >>> from lp.app.widgets.password import PasswordChangeWidget
136
136
 
137
137
  >>> class FormTestView3(LaunchpadFormView):
175
175
submit actions.  These are added to the view class using the "action"
176
176
decorator:
177
177
 
178
 
  >>> from lp.services.webapp import action
 
178
  >>> from lp.app.browser.launchpadform import action
179
179
  >>> class FormTestView4(LaunchpadFormView):
180
180
  ...     schema = IFormTest
181
181
  ...     field_names = ['displayname']
528
528
However, there are cases where a form action is safe (e.g. a "search"
529
529
action).  Those actions can be marked as such:
530
530
 
531
 
  >>> from lp.services.webapp import safe_action
 
531
  >>> from lp.app.browser.launchpadform import safe_action
532
532
  >>> class UnsafeActionTestView(LaunchpadFormView):
533
533
  ...     schema = IFormTest
534
534
  ...     field_names = ['name']
588
588
 
589
589
In other respects, it is used the same way as LaunchpadFormView:
590
590
 
591
 
  >>> from lp.services.webapp import LaunchpadEditFormView
 
591
  >>> from lp.app.browser.launchpadform import LaunchpadEditFormView
592
592
  >>> class FormTestView8(LaunchpadEditFormView):
593
593
  ...     schema = IFormTest
594
594
  ...     field_names = ['displayname']