On 2011-01-15 09:26:38 -0800, Chris McDonough said:
The main thing that object dispatch and traversal have in common is that
both involve a tree. Otherwise, they're not very similar. In object
dispatch, the tree is the "view" code. In traversal, the tree is
essentially data that can be viewed (and often mutated) by view code
that lives elsewhere.
Object dispatch, in the Contentment CMS, is just like traversal: the
object graph being dispatched against directly represents data in the
database, and the _controllers_ the data model maps to (not views) are
executed to determine which view to utilize. E.g. the directory
listing controller is, in its entirety:
@view("Details", "A detailed contents view.")
def view_details(self):
return 'details', None
Note that the @view decorator distinguishes this "method" ("file" in
the URL) as being a view upon the data, vs. @action or @api; this
controls some automated display and security modelling.
Returning 'details' here tells Contentment which view to use; but it
also checks for overrides via extensions (add-on code) and for
overrides in the current theme, allowing theme developers to completely
re-skin any part of the system.
— Alice.
--
You received this message because you are subscribed to the Google Groups
"pylons-devel" group.
To post to this group, send email to pylons-devel@googlegroups.com.
To unsubscribe from this group, send email to
pylons-devel+unsubscr...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/pylons-devel?hl=en.