[Zope] Faking default method for ZSQL w/pluggable brain

Joel Burton jburton@scw.org
Tue, 27 Feb 2001 22:19:39 -0500


For ZSQL methods, I'd rather there appear to be a default method.

So, searching staff_by_id for #17, instead of

   /staff_by_id/15/viewFull

you could search for 

   /staff_by_id/15

and get the same thing (this maps better to our previous, non-Zope 
directory structure.)

So, I wrote a Pluggable Brain for staff_by_id:

class Staff:
	"""Pluggable brain for SCW Staff"""
		
	def index_html(self):
		"Return a default method for this staff person."
		return self.viewFull.__call__(self)


This works fine -- unless my DTML Method viewFull wants to look at 
PARENTS[], AUTHENTICATED_USER, or a whole other slew of things.

Instead, trying

		return self.viewFull(self)

doesn't help instead.

What am I missing?

Thanks for any help!
--
Joel Burton, Director of Information Systems -*- jburton@scw.org
Support Center of Washington (www.scw.org)