[Checkins] SVN: zope2docs/trunk/zdgbook/source/GettingStarted.rst - Use the name 'registrar' instead of 'context'

Baiju M baiju.m.mail at gmail.com
Thu Oct 8 23:34:48 EDT 2009


Log message for revision 104959:
  - Use the name 'registrar' instead of 'context'
  - rst fix
  

Changed:
  U   zope2docs/trunk/zdgbook/source/GettingStarted.rst

-=-
Modified: zope2docs/trunk/zdgbook/source/GettingStarted.rst
===================================================================
--- zope2docs/trunk/zdgbook/source/GettingStarted.rst	2009-10-09 03:29:06 UTC (rev 104958)
+++ zope2docs/trunk/zdgbook/source/GettingStarted.rst	2009-10-09 03:34:47 UTC (rev 104959)
@@ -181,7 +181,7 @@
 
 ::
 
-  def initialize(context):
+  def initialize(registrar):
       pass
 
 And in the ZCML file add these few lines.
@@ -200,12 +200,12 @@
 
 We need three things to make an installable application.
 
- - Form object created using ZPT (manage_addPollMain)
- - A function to define form action (addPollMain)
- - A class to define toplevel application object (PollMain).
+- Form object created using ZPT (manage_addPollMain)
+- A function to define form action (addPollMain)
+- A class to define toplevel application object (PollMain).
 
-And we need to register these things using the `context` passed to
-`initialize` method.
+And we need to register the class along with form and add function
+using the `registrar` object passed to the `initialize` function.
 
 We can define all these things in `app.py` and the form template as
 `manage_addPollMain_form.zpt`.
@@ -253,9 +253,9 @@
 
   from poll.main.app import PollMain, manage_addPollMain, addPollMain
 
-  def initialize(context):
-      context.registerClass(PollMain,
-                            constructors=(manage_addPollMain, addPollMain))
+  def initialize(registrar):
+      registrar.registerClass(PollMain,
+                              constructors=(manage_addPollMain, addPollMain))
 
 The application is now ready to install. But we need to make some
 changes in `poll_build` to recognize this package by Zope 2.



More information about the checkins mailing list