Re: [Zope] Faking default method for ZSQL w/pluggable brain
28 Feb
2001
28 Feb
'01
8:04 p.m.
Joel Burton writes:
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. Try:
return self.viewFull.__call__(self,self.REQUEST)
9167
Age (days ago)
9167
Last active (days ago)
0 comments
1 participants
participants (1)
-
Dieter Maurer