[Checkins] SVN: five.grok/trunk/ * Added dependency on grokcore.view 1.9, grokcore.viewlet 1.1 and
Martin Aspeli
optilude at gmx.net
Tue Jul 21 10:50:31 EDT 2009
Log message for revision 102055:
* Added dependency on grokcore.view 1.9, grokcore.viewlet 1.1 and
grokcore.formlib 1.2, and support for the new CodeView from grokcore.View.
[optilude]
Changed:
U five.grok/trunk/docs/HISTORY.txt
U five.grok/trunk/setup.py
U five.grok/trunk/src/five/grok/README.txt
U five.grok/trunk/src/five/grok/__init__.py
U five.grok/trunk/src/five/grok/components.py
U five.grok/trunk/src/five/grok/ftests/view/argument.py
A five.grok/trunk/src/five/grok/ftests/view/codeview.py
U five.grok/trunk/src/five/grok/ftests/view/layers.py
A five.grok/trunk/src/five/grok/readme_templates/
A five.grok/trunk/src/five/grok/readme_templates/grokvillageview.pt
U five.grok/trunk/versions.cfg
-=-
Modified: five.grok/trunk/docs/HISTORY.txt
===================================================================
--- five.grok/trunk/docs/HISTORY.txt 2009-07-21 14:22:09 UTC (rev 102054)
+++ five.grok/trunk/docs/HISTORY.txt 2009-07-21 14:50:30 UTC (rev 102055)
@@ -1,10 +1,12 @@
Changelog for five.grok
-----------------------
-five.grok - 1.0 (unreleased)
+five.grok - 1.0b2 (2009-07-21)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-* ...
+* Added dependency on grokcore.view 1.9, grokcore.viewlet 1.1 and
+ grokcore.formlib 1.2, and support for the new CodeView from grokcore.View.
+ [optilude]
five.grok - 1.0b1 (2009-06-30)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Modified: five.grok/trunk/setup.py
===================================================================
--- five.grok/trunk/setup.py 2009-07-21 14:22:09 UTC (rev 102054)
+++ five.grok/trunk/setup.py 2009-07-21 14:50:30 UTC (rev 102055)
@@ -31,9 +31,9 @@
'martian',
'five.localsitemanager < 2.0dev',
'grokcore.component',
- 'grokcore.formlib',
- 'grokcore.view >= 1.2',
- 'grokcore.viewlet',
+ 'grokcore.formlib >= 1.2',
+ 'grokcore.view >= 1.9',
+ 'grokcore.viewlet >= 1.1',
'grokcore.security',
'grokcore.site',
'grokcore.annotation',
Modified: five.grok/trunk/src/five/grok/README.txt
===================================================================
--- five.grok/trunk/src/five/grok/README.txt 2009-07-21 14:22:09 UTC (rev 102054)
+++ five.grok/trunk/src/five/grok/README.txt 2009-07-21 14:50:30 UTC (rev 102055)
@@ -51,7 +51,7 @@
Let's define a filesystem directory that will hold the templates
that grok will use with our views.
- <<< grok.templatedir('tests/all/all_test_templates')
+ <<< grok.templatedir('readme_templates')
Let's create a view on the GrokVillage.
@@ -85,7 +85,7 @@
... def numberOfCaveWomen(self):
... return len(self.objectIds())
- <<< class CaveView(grok.View):
+ <<< class CaveView(grok.CodeView):
... grok.context(Cave)
...
... def render(self):
@@ -97,7 +97,7 @@
provide some actual code in the ``update()`` method which is called
before ``render()``::
- <<< class AddCaveWoman(grok.View):
+ <<< class AddCaveWoman(grok.CodeView):
... grok.context(Cave)
... grok.name(u'cave-woman-add')
...
Modified: five.grok/trunk/src/five/grok/__init__.py
===================================================================
--- five.grok/trunk/src/five/grok/__init__.py 2009-07-21 14:22:09 UTC (rev 102054)
+++ five.grok/trunk/src/five/grok/__init__.py 2009-07-21 14:50:30 UTC (rev 102055)
@@ -21,7 +21,7 @@
from grokcore.formlib import *
from five.grok.components import Model, Container, Site, LocalUtility
-from five.grok.components import View, Form, AddForm
+from five.grok.components import View, CodeView, Form, AddForm
from five.grok.components import EditForm, DisplayForm
from five.grok.components import ViewletManager, Viewlet
from five.grok.formlib import AutoFields
Modified: five.grok/trunk/src/five/grok/components.py
===================================================================
--- five.grok/trunk/src/five/grok/components.py 2009-07-21 14:22:09 UTC (rev 102054)
+++ five.grok/trunk/src/five/grok/components.py 2009-07-21 14:50:30 UTC (rev 102055)
@@ -79,7 +79,12 @@
# work, and prevent us to inherit from Acquisition.Implicit
getPhysicalPath = Acquisition.Acquired
+class CodeView(grokcore.view.CodeView, Acquisition.Explicit):
+ # We let getPhysicalPath to be acquired. This make static URL's
+ # work, and prevent us to inherit from Acquisition.Implicit
+ getPhysicalPath = Acquisition.Acquired
+
# TODO: This should probably move to Products.Five.browser
class ViewAwareZopePageTemplate(ZopePageTemplate):
Modified: five.grok/trunk/src/five/grok/ftests/view/argument.py
===================================================================
--- five.grok/trunk/src/five/grok/ftests/view/argument.py 2009-07-21 14:22:09 UTC (rev 102054)
+++ five.grok/trunk/src/five/grok/ftests/view/argument.py 2009-07-21 14:50:30 UTC (rev 102055)
@@ -54,7 +54,7 @@
class Mammoth(grok.Model):
pass
-class RenderWithArguments(grok.View):
+class RenderWithArguments(grok.CodeView):
grok.name('render')
def render(self, message, another):
Added: five.grok/trunk/src/five/grok/ftests/view/codeview.py
===================================================================
--- five.grok/trunk/src/five/grok/ftests/view/codeview.py (rev 0)
+++ five.grok/trunk/src/five/grok/ftests/view/codeview.py 2009-07-21 14:50:30 UTC (rev 102055)
@@ -0,0 +1,24 @@
+"""
+ >>> from five.grok.ftests.view.codeview import *
+ >>> id = getRootFolder()._setObject("manfred", CodeMammoth(id='manfred'))
+
+ >>> from Products.Five.testbrowser import Browser
+ >>> browser = Browser()
+ >>> browser.handleErrors = False
+ >>> browser.open("http://localhost/manfred/@@codepainting")
+ >>> print browser.contents
+ Mona Lisa
+
+"""
+from five import grok
+
+class CodeMammoth(grok.Model):
+
+ def __init__(self, id):
+ super(CodeMammoth, self).__init__(id=id)
+ self.id = id
+
+class CodePainting(grok.CodeView):
+
+ def render(self):
+ return "Mona Lisa"
Modified: five.grok/trunk/src/five/grok/ftests/view/layers.py
===================================================================
--- five.grok/trunk/src/five/grok/ftests/view/layers.py 2009-07-21 14:22:09 UTC (rev 102054)
+++ five.grok/trunk/src/five/grok/ftests/view/layers.py 2009-07-21 14:50:30 UTC (rev 102055)
@@ -45,14 +45,14 @@
</html>
""")
-class MoreDrawings(grok.View):
+class MoreDrawings(grok.CodeView):
grok.layer(rotterdam)
def render(self):
return "Pretty"
-class EvenMoreDrawings(grok.View):
+class EvenMoreDrawings(grok.CodeView):
grok.layer(MySkinLayer)
def render(self):
Added: five.grok/trunk/src/five/grok/readme_templates/grokvillageview.pt
===================================================================
--- five.grok/trunk/src/five/grok/readme_templates/grokvillageview.pt (rev 0)
+++ five.grok/trunk/src/five/grok/readme_templates/grokvillageview.pt 2009-07-21 14:50:30 UTC (rev 102055)
@@ -0,0 +1,11 @@
+<html>
+<body>
+<div tal:repeat="cave view/getCaves">
+In cave <span tal:replace="cave/id"/> there is <span tal:replace="cave/caveWomen"/> cavewomen.
+</div>
+<div>
+ And just to prove that we have a Zope 2 template, let's do something
+ ugly: <b tal:content="here/id" />
+</div>
+</body>
+</html>
Modified: five.grok/trunk/versions.cfg
===================================================================
--- five.grok/trunk/versions.cfg 2009-07-21 14:22:09 UTC (rev 102054)
+++ five.grok/trunk/versions.cfg 2009-07-21 14:50:30 UTC (rev 102055)
@@ -6,10 +6,10 @@
[versions]
ClientForm = 0.2.9
grokcore.component = 1.7
-grokcore.formlib = 1.1
+grokcore.formlib = 1.2
grokcore.security = 1.1
-grokcore.view = 1.7
-grokcore.viewlet = 1.0
+grokcore.view = 1.9
+grokcore.viewlet = 1.1
grokui.admin = 0.3.2
martian = 0.11
mechanize = 0.1.7b
More information about the Checkins
mailing list