[Repoze-dev] (repoze.bfg) Adding several models

2009-06-04 Thread Jonas Melian
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-06-04 Thread Paul Everitt

On Jun 4, 2009, at 8:26 AM, Malthe Borch wrote:

 2009/6/4 Jonas Melian jo...@mailup.net:
 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