~launchpad-pqm/launchpad/devel

« back to all changes in this revision

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

  • Committer: Curtis Hovey
  • Date: 2011-12-24 17:49:30 UTC
  • mto: This revision was merged to the branch mainline in revision 14602.
  • Revision ID: curtis.hovey@canonical.com-20111224174930-xk1d5cvhyxq46ctf
Moved webapp to lp.services.

Show diffs side-by-side

added added

removed removed

Lines of Context:
65
65
"schema" attribute:
66
66
 
67
67
  >>> from lp.app.browser.launchpadform import LaunchpadFormView
68
 
  >>> from canonical.launchpad.webapp.servers import LaunchpadTestRequest
 
68
  >>> from lp.services.webapp.servers import LaunchpadTestRequest
69
69
 
70
70
  >>> class FormTestView1(LaunchpadFormView):
71
71
  ...     schema = IFormTest
131
131
attribute:
132
132
 
133
133
  >>> from zope.app.form.browser import TextWidget
134
 
  >>> from canonical.launchpad.webapp import custom_widget
 
134
  >>> from lp.services.webapp 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 canonical.launchpad.webapp import action
 
178
  >>> from lp.services.webapp 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 canonical.launchpad.webapp import safe_action
 
531
  >>> from lp.services.webapp 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 canonical.launchpad.webapp import LaunchpadEditFormView
 
591
  >>> from lp.services.webapp import LaunchpadEditFormView
592
592
  >>> class FormTestView8(LaunchpadEditFormView):
593
593
  ...     schema = IFormTest
594
594
  ...     field_names = ['displayname']