Zop3&bfg
潘俊勇
reply-to [email protected] to python-cn`CPyUG`华蟒用户组 <[email protected]> date Mon, Jan 5, 2009 at 23:57 subject [CPyUG:75931] Re: 有正在学习和使用Zope3的朋友吗?
哈,大家都说zope3的坏话,我也准备曲线救国了。
我现在推荐大家用bfg,不给点有内容的东西,大家就不肯跟风了:
这个是bfg的示例站点,源代码在这里:
MVT中:
- - M: model在这里: django的兄弟不难看懂吧
- V: view就是函数: http://svn.repoze.org/repoze.shootout/trunk/repoze/shootout/views.py
- T:模板在这里: http://svn.repoze.org/repoze.shootout/trunk/repoze/shootout/templates/ 是不是很奇怪,这模板怎么这么简单?没有theme的东东?
- theme分离了的,在这里:
- theme如何和前面的模板套在一起呢?
WSGI上有配置,用deliverance的filter: http://svn.repoze.org/repoze.shootout/trunk/shootout.ini
- deliverance的具体theme加载规则在这里配置: 彻底实现开发人员和美工的分离!!
不知道大家有没有耐心去看代码,不要紧,科普工作会继续下去的,我们会花力气推这个bfg的
Limodou feeling
limodou <[email protected]> reply-to [email protected] to [email protected] date Tue, Jan 6, 2009 at 08:49 subject [CPyUG:75943] Re: 有正在学习和使用Zope3的朋友吗?
> 不如老潘写一个Hello, bfg的入门教程啊。
刚看了一点代码谈点个人感受和问题:
- 1. 不知道bfg与zope或其它框架的具体关系如何?
- 2. 看到bfg使用了sqlalchemy, paste, webob,formencode,那么好象使用zope相关的东西:Interface, configure.zcml, permission,theme(?)
- 3. 似乎没有ZClass简单啊。比如:url的配置和permission好象是在configure.zcml,如何自定义url?对于模板的处理好象是使用zpt,因为看到有tal了。不过模板不能自动映射,要使用象render_template_to_response,这样的函数,的确是django的风格,但也说明没有自动模板映射,即不能只返回数据,自动查找对应的模板。
- 4. 部分配置是使用paste来处理的,因此要有一个单独的ini文件,这样与configure.zcml不是一体的,感觉不统一。当然也表明了,bfg中使用的外部的东西都可以不用。
因上从上面,我看到了部分zope的影子,部分pylons的风格。不知道zope的东西还剩多少:
- Interface,configure.zcml, permission, theme? 这些哪些算是bfg的特色,与其它的框架的区别在哪里?能否再扫扫盲。
反馈
创建 by -- ZoomQuiet [DateTime(2009-01-06T01:05:55Z)]
