[Checkins] SVN: grok/branches/luciano-tutorial/doc/ replaced sample
app from storing_data with new one called "pebbles"
Luciano Ramalho
luciano at ramalho.org
Thu Jul 12 16:11:57 EDT 2007
Log message for revision 77787:
replaced sample app from storing_data with new one called "pebbles"
Changed:
D grok/branches/luciano-tutorial/doc/groktut/redirection/src/sample/
A grok/branches/luciano-tutorial/doc/groktut/storing_data/src/pebbles/
A grok/branches/luciano-tutorial/doc/groktut/storing_data/src/pebbles/__init__.py
A grok/branches/luciano-tutorial/doc/groktut/storing_data/src/pebbles/app.py
A grok/branches/luciano-tutorial/doc/groktut/storing_data/src/pebbles/app_templates/
A grok/branches/luciano-tutorial/doc/groktut/storing_data/src/pebbles/app_templates/edit.pt
A grok/branches/luciano-tutorial/doc/groktut/storing_data/src/pebbles/app_templates/index.pt
A grok/branches/luciano-tutorial/doc/groktut/storing_data/src/pebbles/configure.zcml
A grok/branches/luciano-tutorial/doc/groktut/storing_data/src/pebbles/ftesting.zcml
A grok/branches/luciano-tutorial/doc/groktut/storing_data/src/pebbles/testing.py
D grok/branches/luciano-tutorial/doc/groktut/storing_data/src/sample/
U grok/branches/luciano-tutorial/doc/tutorial.txt
-=-
Added: grok/branches/luciano-tutorial/doc/groktut/storing_data/src/pebbles/__init__.py
===================================================================
--- grok/branches/luciano-tutorial/doc/groktut/storing_data/src/pebbles/__init__.py (rev 0)
+++ grok/branches/luciano-tutorial/doc/groktut/storing_data/src/pebbles/__init__.py 2007-07-12 20:11:56 UTC (rev 77787)
@@ -0,0 +1 @@
+# this directory is a package
Added: grok/branches/luciano-tutorial/doc/groktut/storing_data/src/pebbles/app.py
===================================================================
--- grok/branches/luciano-tutorial/doc/groktut/storing_data/src/pebbles/app.py (rev 0)
+++ grok/branches/luciano-tutorial/doc/groktut/storing_data/src/pebbles/app.py 2007-07-12 20:11:56 UTC (rev 77787)
@@ -0,0 +1,13 @@
+import grok
+
+class Pebbles(grok.Application, grok.Container):
+ quantity = 0
+
+class Index(grok.View):
+ pass # see app_templates/index.pt
+
+class Edit(grok.View):
+ def update(self, quantity=None):
+ if quantity is None:
+ return
+ self.context.quantity = quantity
\ No newline at end of file
Added: grok/branches/luciano-tutorial/doc/groktut/storing_data/src/pebbles/app_templates/edit.pt
===================================================================
--- grok/branches/luciano-tutorial/doc/groktut/storing_data/src/pebbles/app_templates/edit.pt (rev 0)
+++ grok/branches/luciano-tutorial/doc/groktut/storing_data/src/pebbles/app_templates/edit.pt 2007-07-12 20:11:56 UTC (rev 77787)
@@ -0,0 +1,9 @@
+<html>
+<body>
+<form tal:attributes="action view/url" method="POST">
+ Quantity to remember: <input type="text" name="quantity" value=""
+ tal:attributes="value context/quantity"/><br />
+ <input type="submit" value="Store" />
+</form>
+</body>
+</html>
\ No newline at end of file
Added: grok/branches/luciano-tutorial/doc/groktut/storing_data/src/pebbles/app_templates/index.pt
===================================================================
--- grok/branches/luciano-tutorial/doc/groktut/storing_data/src/pebbles/app_templates/index.pt (rev 0)
+++ grok/branches/luciano-tutorial/doc/groktut/storing_data/src/pebbles/app_templates/index.pt 2007-07-12 20:11:56 UTC (rev 77787)
@@ -0,0 +1,8 @@
+<html>
+<head>
+</head>
+<body>
+ <p>The quantity: <span tal:replace="python:context.quantity">999</span></p>
+
+</body>
+</html>
Added: grok/branches/luciano-tutorial/doc/groktut/storing_data/src/pebbles/configure.zcml
===================================================================
--- grok/branches/luciano-tutorial/doc/groktut/storing_data/src/pebbles/configure.zcml (rev 0)
+++ grok/branches/luciano-tutorial/doc/groktut/storing_data/src/pebbles/configure.zcml 2007-07-12 20:11:56 UTC (rev 77787)
@@ -0,0 +1,5 @@
+<configure xmlns="http://namespaces.zope.org/zope"
+ xmlns:grok="http://namespaces.zope.org/grok">
+ <include package="grok" />
+ <grok:grok package="." />
+</configure>
Added: grok/branches/luciano-tutorial/doc/groktut/storing_data/src/pebbles/ftesting.zcml
===================================================================
--- grok/branches/luciano-tutorial/doc/groktut/storing_data/src/pebbles/ftesting.zcml (rev 0)
+++ grok/branches/luciano-tutorial/doc/groktut/storing_data/src/pebbles/ftesting.zcml 2007-07-12 20:11:56 UTC (rev 77787)
@@ -0,0 +1,34 @@
+<configure
+ xmlns="http://namespaces.zope.org/zope"
+ i18n_domain="pebbles"
+ package="pebbles"
+ >
+
+ <include package="grok" />
+
+ <!-- Typical functional testing security setup -->
+ <securityPolicy
+ component="zope.app.securitypolicy.zopepolicy.ZopeSecurityPolicy"
+ />
+
+ <unauthenticatedPrincipal
+ id="zope.anybody"
+ title="Unauthenticated User"
+ />
+ <grant
+ permission="zope.View"
+ principal="zope.anybody"
+ />
+
+ <principal
+ id="zope.mgr"
+ title="Manager"
+ login="mgr"
+ password="mgrpw"
+ />
+
+ <role id="zope.Manager" title="Site Manager" />
+ <grantAll role="zope.Manager" />
+ <grant role="zope.Manager" principal="zope.mgr" />
+
+</configure>
Added: grok/branches/luciano-tutorial/doc/groktut/storing_data/src/pebbles/testing.py
===================================================================
--- grok/branches/luciano-tutorial/doc/groktut/storing_data/src/pebbles/testing.py (rev 0)
+++ grok/branches/luciano-tutorial/doc/groktut/storing_data/src/pebbles/testing.py 2007-07-12 20:11:56 UTC (rev 77787)
@@ -0,0 +1,7 @@
+import os.path
+import pebbles
+from zope.app.testing.functional import ZCMLLayer
+
+ftesting_zcml = os.path.join(
+ os.path.dirname(pebbles.__file__), 'ftesting.zcml')
+FunctionalLayer = ZCMLLayer(ftesting_zcml, __name__, 'FunctionalLayer')
Modified: grok/branches/luciano-tutorial/doc/tutorial.txt
===================================================================
--- grok/branches/luciano-tutorial/doc/tutorial.txt 2007-07-12 19:41:41 UTC (rev 77786)
+++ grok/branches/luciano-tutorial/doc/tutorial.txt 2007-07-12 20:11:56 UTC (rev 77787)
@@ -947,7 +947,7 @@
You should see ``default text``.
-Now let's modify the text by doing to the edit page of the application:
+Now let's modify the text by going to the edit page of the application:
http://localhost:8080/test/edit
More information about the Checkins
mailing list