Hello!
Coming from Pylons, I'm a newbie to the object graph traversal world, so
this question might be slightly misplaced (but hopefully a no-brainer
for the bfg gurus...).
I very much like the concept of looking up my model object before
dispatching to a view that operates on it. However, what bothers me
about the standard traversal algorithm is that, for a URL like
/cars/beetle/wheels/front_left
I have to promote the containers ("cars" and "wheels") to first class
citizens in my model (by defining CarContainer and WheelContainer
classes that I can then instantiate and return as the context object
from the parent's __getitem__), where in fact they are just collections
held by their mutual parent model objects (the Root object in case of
the cars collection - which is in itself artificial, but I'm willing to
pay that price for traversability - and the Car object in case of the
wheels collection).
I guess I'm asking if there is a standard, "bfg-approved" way of
avoiding artificial container model classes - or did I just "not get it"
yet?!
I'm very grateful for any hints and pointers you may have on this issue.
Thanks,
Oliver
--
--------------------------------------------------------------------
F. Oliver Gathmann, Ph.D.
Director IT Unit
Cenix BioScience GmbH
Tatzberg 47 phone: +49 (351) 4173-136
D-01307 Dresden, Germany fax: +49 (351) 4173-109
--------------------------------------------------------------------
---------------------------------------------------------
Sitz der Gesellschaft (Place of Business): Dresden
Geschaeftsfuehrer (CEO): Dr. Christophe J. Echeverri
Amtsgericht (Local Court): Dresden, HRB 19964
Ust-ID (VAT-No.): DE205824437
---------------------------------------------------------
_______________________________________________
Repoze-dev mailing list
Repoze-dev@lists.repoze.org
http://lists.repoze.org/listinfo/repoze-dev