[Repoze-dev] (repoze.bfg) Adding several models
Is possible to have several models? If it's so, how are they returned from root? repoze.bfg: http://static.repoze.org/bfgdocs/narr/project.html#models-py -- http://www.fastmail.fm - Faster than the air-speed velocity of an unladen european swallow ___ Repoze-dev mailing list Repoze-dev@lists.repoze.org http://lists.repoze.org/listinfo/repoze-dev
Re: [Repoze-dev] (repoze.bfg) Adding several models
2009/6/4 Jonas Melian : > Is possible to have several models? If it's so, how are they returned > from root? The default object traversal uses the ``__getitem__`` method to traverse to subobjects. These could be instances of "other" models. \malthe ___ Repoze-dev mailing list Repoze-dev@lists.repoze.org http://lists.repoze.org/listinfo/repoze-dev
[Repoze-dev] make repoze dists more buildout friendly
Hi, I'am using buildout and repoze.bfg. It worked fine until i came to the point where i tried to integrate repoze.what. repoze.what is on pypi, repoze.who is on an own index server. Now i came up with a solution (please please document this somewhere), here the minimal buildout: --snip- [buildout] parts = instance find-links = http://dist.repoze.org/bfg/1.0/ [instance] recipe = repoze.recipe.egg:scripts eggs = repoze.what repoze.bfg --/snip- The major disadvantage over using the index= approach is: Version pinning is needed to be done manually (the extension buildout.dumppickedversions helps a lot here). Why not put a version.cfg file at http://dist.repoze.org/bfg/1.0/ version.cfg for all files in there? It should be easy to auto-create such from the files in the directory. This would make repoze.bfg distributions more buildout-friendly and also documents explizit the dependend versions used in the specific bundle. Additional i learned today the major difference between find-links and index in buildout (at the end in setuptools), as wiggy said: "find-links= expects a directory with files in it, index= expects a directory with a subdirectory for every package" Odd enough, but its setuptools. regards -- Jens W. Klein - Klein & Partner KEG - BlueDynamics Alliance ___ Repoze-dev mailing list Repoze-dev@lists.repoze.org http://lists.repoze.org/listinfo/repoze-dev
Re: [Repoze-dev] (repoze.bfg) Adding several models
On Jun 4, 2009, at 8:26 AM, Malthe Borch wrote: > 2009/6/4 Jonas Melian : >> Is possible to have several models? If it's so, how are they returned >> from root? > > The default object traversal uses the ``__getitem__`` method to > traverse to subobjects. These could be instances of "other" models. The lxmlgraph tutorial I wrote (which should probably be deprecated) shows how traversal can get very custom: http://docs.repoze.org/bfg/tutorials/lxmlgraph/step02.html#module-models-py In that I use the identifier as an argument to an XPath inside a __getitem__. --Paul ___ Repoze-dev mailing list Repoze-dev@lists.repoze.org http://lists.repoze.org/listinfo/repoze-dev
Re: [Repoze-dev] (repoze.bfg) Adding several models
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Jonas Melian wrote: > Is possible to have several models? If it's so, how are they returned > from root? > > > repoze.bfg: http://static.repoze.org/bfgdocs/narr/project.html#models-py We just did a tutorial for the Plone Symposium in Penn State which shows a traversal-based wiki and wiki pages (separate model classes): http://docs.repoze.org/bfg/tutorials/bfgwiki/index.html and the section where the models are defined: http://docs.repoze.org/bfg/tutorials/bfgwiki/definingmodels.html#looking-at-the-result-of-our-edits-to-models-py The traversal machinery uses '__getitem__', which is why the Wiki class derives from PersistentMapping, which is a dict-like class that plays well with the ZODB. Tres. - -- === Tres Seaver +1 540-429-0999 tsea...@palladion.com Palladion Software "Excellence by Design"http://palladion.com -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFKJ+YM+gerLs4ltQ4RAnAbAKDIpYndH/BhSRhawYhznhC2of1RKgCePwQP Q/zyNeZq21lQ2QJgyfAxKfg= =tz63 -END PGP SIGNATURE- ___ Repoze-dev mailing list Repoze-dev@lists.repoze.org http://lists.repoze.org/listinfo/repoze-dev
Re: [Repoze-dev] problem with routes and "model_url"
On 6/3/09 12:44 PM, Stephan Altmueller wrote: > > > Hi Chris, > > Thank you for your amazingly fast response. > > Indeed your example works as described. > After digging deeper I figured that my > problem is caused by adding the "root" route to the configure.zcml: > > path="" > name="root" > view=".views.root_view" > /> > > Everything else is identical to your example and "root_view" is a > copy of "my_view" from your previous email. > > When I add the root route the routes, I get either "/" or "/buckets" > for both routes depending on their order configure.zcml. Sure enough, this is a bug. Thanks for reporting it; I'm not entirely sure what the best way to fix it is. In the meantime, you can use routes.url_for: return routes.url_for("buckets", **context.__dict__) - C ___ Repoze-dev mailing list Repoze-dev@lists.repoze.org http://lists.repoze.org/listinfo/repoze-dev