templer模板用于dexterity
项目描述
简介
Dexterity 是 Plone 的内容类型开发工具。它支持通过 Web 和文件系统开发 Plone 的新内容类型。Templer 是一个 Python 源包骨架创建器。
templer.dexterity 提供了一种快速创建 Dexterity 扩展骨架的机制。它还使得向现有骨架添加新内容类型变得容易。使用此工具构建的新内容类型很容易与您可能使用 Dexterity 的 TTW 规范编辑器开发的数据类型集成。
这是一个开发工具。您应该熟悉 Plone 和 buildout 才能使用它。您应该已经在其 Plone 开发实例中安装了 Dexterity,并准备好开始学习使用它。
安装
将这些行添加到 buildout.cfg 中
[buildout] parts = templer [templer] recipe = zc.recipe.egg eggs = PasteScript templer.core templer.zope templer.plone templer.dexterity ${instance:eggs}
其中 instance 是 Zope 实例或 ZODB 客户端的部件名称。
运行 buildout。
使用方法
在 buildout 的 src 目录中创建 Dexterity 内容包,通常是这样做的
../bin/templer dexterity
向现有包添加内容类型骨架
cd yourbuildout/src/your-product/src ../../../bin/paster add content_type
添加行为骨架
cd yourbuildout/src/your-product/src ../../../bin/paster add behavior
您必须在将内容类型或行为添加到新包之前,将新项目添加到 buildout 并运行 buildout。
注意
蛋目录
为了支持本地命令,templer 将在您的产品内部创建 Paste、PasteDeploy 和 PasteScript 蛋。这些仅用于开发。您可以从您的扩展分发包中移除它们。
同时删除
setup_requires=["PasteScript"], paster_plugins=["templer.localcommands"],
从 packages setup.py。
错误
如果在尝试运行 paster add 时遇到如下错误
pkg_resources.DistributionNotFound: plone.app.relationfield: Not Found for: my.product (did you run python setup.py develop?)
那么您需要确保 Paster 知道您的 buildout 中所有相关的蛋。
将 ${instance:eggs} 添加到您的 buildout 中 paster 部分,如下所示
[templer] recipe = zc.recipe.egg eggs = ... ${instance:eggs} entry-points = paster=paste.script.command:run
其中 instance 是您的 plone.recipe.zope2instance 部分的名称。重新运行 buildout,问题应该会解决。
变更日志
1.0a1
主要来自 zopeskel.dexterity;有关更早的历史,请参阅该项目存储库。[smcmahon]
项目详情
templer.dexterity-1.0a1.zip 的散列
算法 | 散列摘要 | |
---|---|---|
SHA256 | 0ea221cf88594dee1317d9171e163335a31303f77dfec1111ea73c4e3e17432d |
|
MD5 | 3d1c1a950eaf9f055774e7dd899be2bc |
|
BLAKE2b-256 | 029a2b9f11a2e5792056cdae2ac8fe21a46d86d190a06f332467b1a5c75ae1f8 |