Re: [Zope-dev] Overriding a method in an instance.

2000-07-19 Thread Chris Withers

Shane Hathaway wrote:
 I have an idea: the _objects attribute of ObjectManagers could include
 a "configurable" flag, which would tell _checkId that the object can be
 overridden.

Shane,

Is this what became the ConfigurableInstances thing at:
http://www.zope.org/Members/hathawsh/ConfigurableInstances/
?

Or is that something different that solved the same problem?

cheers,

Chris

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )




Re: [Zope-dev] Overriding a method in an instance.

2000-07-19 Thread Shane Hathaway

Chris Withers wrote:
 
 Shane Hathaway wrote:
  I have an idea: the _objects attribute of ObjectManagers could include
  a "configurable" flag, which would tell _checkId that the object can be
  overridden.
 
 Shane,
 
 Is this what became the ConfigurableInstances thing at:
 http://www.zope.org/Members/hathawsh/ConfigurableInstances/
 ?

Yes, for now.  We need to start a Wiki on dev.zope.org about this.

Shane

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )




Re: [Zope-dev] Overriding a method in an instance.

2000-07-10 Thread Chris Withers

Monty Taylor wrote:
 Make a folder that contains the overridden methods and call things
 through the context of that folder.

Neat trick :-)
We love acquisiton, but it won't quite do it :(
The default index_html will get called, unless you put /folder/ on the
end of your URL. which is horrible :(

 In the case of what it seems you want to do I'd say sub-classing is going
 to be your real answer.

Actually, the more important case is for Trackers, where you probably
want them to look/act differently on an instance by instance basis.

This is mainly for presentation methods, but there's no reason if it's
solved for them, it can't be used for any other methods...

I imagine it'd need playing with python name spaces and/or acquisition
to implement, but might well be worth it.

cheers,

Chris

PS: For acquisiton, is it context before containment or containment
before cotext?

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )




Re: [Zope-dev] Overriding a method in an instance.

2000-07-10 Thread Shane Hathaway

Chris Withers wrote:
 
 Monty Taylor wrote:
  Make a folder that contains the overridden methods and call things
  through the context of that folder.
 
 Neat trick :-)
 We love acquisiton, but it won't quite do it :(
 The default index_html will get called, unless you put /folder/ on the
 end of your URL. which is horrible :(
 
  In the case of what it seems you want to do I'd say sub-classing is going
  to be your real answer.
 
 Actually, the more important case is for Trackers, where you probably
 want them to look/act differently on an instance by instance basis.
 
 This is mainly for presentation methods, but there's no reason if it's
 solved for them, it can't be used for any other methods...

I have an idea: the _objects attribute of ObjectManagers could include
a "configurable" flag, which would tell _checkId that the object can be
overridden.

 PS: For acquisiton, is it context before containment or containment
 before cotext?

Interesting situation, that... it's always containment before context,
but standard practice in DTML figures out what initial container to use
from the context.

I just figured that last week.  To determine context, you get
obj.aq_parent.  To determine the container, you get
obj.aq_inner.aq_parent.  The strange thing about DTML methods is that
namespace attributes are essentially derived from method.aq_parent. 
method.aq_parent could be anywhere and is determined by the
second-to-last element in the URL.  But from there, acquisition
continues normally, searching via containment first and then context.

So it's mostly right-to-left, but sometimes left-to-right, and
sometimes in a less than predictable order.  I have an external method
that makes it clearer, if you're interested.

Shane

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )