From a962d0a1403ed38aaa95cf2ef9b31f12af07728e Mon Sep 17 00:00:00 2001 From: Izhar Firdaus Date: Thu, 25 Oct 2012 01:26:11 +0800 Subject: [PATCH 1/8] do not generate custom content class anymore. --- .../content/+content_class_filename+.py_tmpl | 15 --------------- .../default/types/+types_xml_filename+.xml_tmpl | 7 +++++-- 2 files changed, 5 insertions(+), 17 deletions(-) diff --git a/src/templer/dexterity/localcommands/templates/dexterity/content/+content_class_filename+.py_tmpl b/src/templer/dexterity/localcommands/templates/dexterity/content/+content_class_filename+.py_tmpl index 64bccea..70aa6d4 100644 --- a/src/templer/dexterity/localcommands/templates/dexterity/content/+content_class_filename+.py_tmpl +++ b/src/templer/dexterity/localcommands/templates/dexterity/content/+content_class_filename+.py_tmpl @@ -38,21 +38,6 @@ class ${interface_name}(form.Schema, IImageScaleTraversable): form.model("models/${content_class_filename}.xml") -\# Custom content-type class; objects created for this content type will -\# be instances of this class. Use this class to add content-type specific -\# methods and properties. Put methods that are mainly useful for rendering -\# in separate view classes. - -#if str($folderish) == 'True' -class ${contenttype_classname}(dexterity.Container): -#else -class ${contenttype_classname}(dexterity.Item): -#end if - grok.implements(${interface_name}) - - # Add your class methods and properties here - - \# View class \# The view will automatically use a similarly named template in \# ${content_class_filename}_templates. diff --git a/src/templer/dexterity/localcommands/templates/dexterity/content/profiles/default/types/+types_xml_filename+.xml_tmpl b/src/templer/dexterity/localcommands/templates/dexterity/content/profiles/default/types/+types_xml_filename+.xml_tmpl index b3f082a..302a4fc 100644 --- a/src/templer/dexterity/localcommands/templates/dexterity/content/profiles/default/types/+types_xml_filename+.xml_tmpl +++ b/src/templer/dexterity/localcommands/templates/dexterity/content/profiles/default/types/+types_xml_filename+.xml_tmpl @@ -20,8 +20,11 @@ ${package_dotted_name}.${content_class_filename}.${interface_name} - ${package_dotted_name}.${content_class_filename}.${contenttype_classname} - +#if str(folderish) == 'True' + plone.directives.dexterity.Container +#else + plone.directives.dexterity.Item +#end if From 166e93b6b3a8a0a2c2cec28f4df2b3e53f9a9e19 Mon Sep 17 00:00:00 2001 From: Izhar Firdaus Date: Thu, 25 Oct 2012 08:26:52 +0800 Subject: [PATCH 2/8] add omelette and Pillow into buildout --- .../templates/dexterity/buildout.cfg_tmpl | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/templer/dexterity/templates/dexterity/buildout.cfg_tmpl b/src/templer/dexterity/templates/dexterity/buildout.cfg_tmpl index d81b581..0bdf210 100644 --- a/src/templer/dexterity/templates/dexterity/buildout.cfg_tmpl +++ b/src/templer/dexterity/templates/dexterity/buildout.cfg_tmpl @@ -1,13 +1,17 @@ [buildout] -extends = http://dist.plone.org/release/4.2.1/versions.cfg -develop = . -parts = test -versions = versions +extends = http://svn.plone.org/svn/collective/buildout/plonetest/test-4.x.cfg +package-name = ${namespace_package}.${package} +parts += omelette [test] recipe = zc.recipe.testrunner defaults = ['--tests-pattern', '^f?tests$', '-v'] eggs = ${namespace_package}.${package} [test] -[versions] +[omelette] +recipe = collective.recipe.omelette +eggs = \${instance:eggs} + +[instance] +eggs += Pillow From 074991f3cf47d90e3e6cb5aea4cd0a3f4982dde2 Mon Sep 17 00:00:00 2001 From: Izhar Firdaus Date: Thu, 25 Oct 2012 08:29:28 +0800 Subject: [PATCH 3/8] fix missing $ --- .../profiles/default/types/+types_xml_filename+.xml_tmpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/templer/dexterity/localcommands/templates/dexterity/content/profiles/default/types/+types_xml_filename+.xml_tmpl b/src/templer/dexterity/localcommands/templates/dexterity/content/profiles/default/types/+types_xml_filename+.xml_tmpl index 302a4fc..f9ef2f5 100644 --- a/src/templer/dexterity/localcommands/templates/dexterity/content/profiles/default/types/+types_xml_filename+.xml_tmpl +++ b/src/templer/dexterity/localcommands/templates/dexterity/content/profiles/default/types/+types_xml_filename+.xml_tmpl @@ -20,7 +20,7 @@ ${package_dotted_name}.${content_class_filename}.${interface_name} -#if str(folderish) == 'True' +#if str($folderish) == 'True' plone.directives.dexterity.Container #else plone.directives.dexterity.Item From 53c9f8b80299d374198ed7a2900a6028db503327 Mon Sep 17 00:00:00 2001 From: Izhar Firdaus Date: Thu, 25 Oct 2012 08:32:05 +0800 Subject: [PATCH 4/8] use dexterity.DisplayForm for default index view --- .../content/+content_class_filename+.py_tmpl | 10 ++------- .../{sampleview.pt_tmpl => index.pt_tmpl} | 22 ++++++++++++++----- 2 files changed, 18 insertions(+), 14 deletions(-) rename src/templer/dexterity/localcommands/templates/dexterity/content/+content_class_filename+_templates/{sampleview.pt_tmpl => index.pt_tmpl} (50%) diff --git a/src/templer/dexterity/localcommands/templates/dexterity/content/+content_class_filename+.py_tmpl b/src/templer/dexterity/localcommands/templates/dexterity/content/+content_class_filename+.py_tmpl index 70aa6d4..48bbd17 100644 --- a/src/templer/dexterity/localcommands/templates/dexterity/content/+content_class_filename+.py_tmpl +++ b/src/templer/dexterity/localcommands/templates/dexterity/content/+content_class_filename+.py_tmpl @@ -42,14 +42,8 @@ class ${interface_name}(form.Schema, IImageScaleTraversable): \# The view will automatically use a similarly named template in \# ${content_class_filename}_templates. \# Template filenames should be all lower case. -\# The view will render when you request a content object with this -\# interface with "/@@sampleview" appended. -\# You may make this the default view for content objects -\# of this type by uncommenting the grok.name line below or by -\# changing the view class name and template filename to View / view.pt. -class SampleView(grok.View): +class Index(dexterity.DisplayForm): grok.context(${interface_name}) grok.require('zope2.View') - - \# grok.name('view') + grok.name('view') diff --git a/src/templer/dexterity/localcommands/templates/dexterity/content/+content_class_filename+_templates/sampleview.pt_tmpl b/src/templer/dexterity/localcommands/templates/dexterity/content/+content_class_filename+_templates/index.pt_tmpl similarity index 50% rename from src/templer/dexterity/localcommands/templates/dexterity/content/+content_class_filename+_templates/sampleview.pt_tmpl rename to src/templer/dexterity/localcommands/templates/dexterity/content/+content_class_filename+_templates/index.pt_tmpl index 6607105..8507f6a 100644 --- a/src/templer/dexterity/localcommands/templates/dexterity/content/+content_class_filename+_templates/sampleview.pt_tmpl +++ b/src/templer/dexterity/localcommands/templates/dexterity/content/+content_class_filename+_templates/index.pt_tmpl @@ -18,14 +18,24 @@ -

- Rendered from - ${content_class_filename}_templates/ -

+ +
+
+#if str($folderish) == 'True' +
+ Contents + + + +
+#end if +
From 25f4638b4da7df4a1bc56eb024f5f070eedddd8d Mon Sep 17 00:00:00 2001 From: Izhar Firdaus Date: Thu, 25 Oct 2012 09:14:00 +0800 Subject: [PATCH 7/8] update HISTORY.txt --- docs/HISTORY.txt | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/docs/HISTORY.txt b/docs/HISTORY.txt index 53a73dd..513b5c4 100644 --- a/docs/HISTORY.txt +++ b/docs/HISTORY.txt @@ -7,3 +7,11 @@ Changelog * Mostly derived from zopeskel.dexterity; see that project's repository for earlier history. [smcmahon] + +* Replaced SampleView with Index view that based on dexterity.DisplayForm and + plone.app.dexterity default view + [izhar] + +* Inherit and plonetest's plone4.x.cfg for buildout so that we always use the + latest plone4 buildout. + [izhar] From 1be4b051a52c9a8e8625032261ba3abc57c54b05 Mon Sep 17 00:00:00 2001 From: Izhar Firdaus Date: Thu, 25 Oct 2012 10:02:41 +0800 Subject: [PATCH 8/8] plone.directives.dexterity.{Container,Item} are actually plone.dexterity.content.{Container, Item}. Use plone.dexterity.content as its more consistent with the dexterity manual. --- .../profiles/default/types/+types_xml_filename+.xml_tmpl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/templer/dexterity/localcommands/templates/dexterity/content/profiles/default/types/+types_xml_filename+.xml_tmpl b/src/templer/dexterity/localcommands/templates/dexterity/content/profiles/default/types/+types_xml_filename+.xml_tmpl index f9ef2f5..8260713 100644 --- a/src/templer/dexterity/localcommands/templates/dexterity/content/profiles/default/types/+types_xml_filename+.xml_tmpl +++ b/src/templer/dexterity/localcommands/templates/dexterity/content/profiles/default/types/+types_xml_filename+.xml_tmpl @@ -21,9 +21,9 @@ ${package_dotted_name}.${content_class_filename}.${interface_name} #if str($folderish) == 'True' - plone.directives.dexterity.Container + plone.dexterity.content.Container #else - plone.directives.dexterity.Item + plone.dexterity.content.Item #end if