I'm trying to write a Content Type Registry predicate that needs
access to the context to be able to decide what content type to
create, however in ContentTypeRegistry, findTypeName, the predicate is
not wrapped in acquisition when called.

I would like to propose to wrap the predicate into an acquisition
context before calling it so that smarter predicates can be created.

Here's the proposed change:

Index: ContentTypeRegistry.py
RCS file:
retrieving revision
diff -u -r1.14.10.2 ContentTypeRegistry.py
--- ContentTypeRegistry.py      23 Apr 2004 21:11:33 -0000
+++ ContentTypeRegistry.py      25 Jul 2005 18:30:04 -0000
@@ -538,6 +538,7 @@
         for predicate_id in self.predicate_ids:
             pred, typeObjectName = self.predicates[ predicate_id ]
+            pred = pred.__of__(self)
             if pred( name, typ, body ):
                 return typeObjectName

Sidnei da Silva
Enfold Systems, LLC.
Zope-CMF maillist  -  Zope-CMF@lists.zope.org

See http://collector.zope.org/CMF for bug reports and feature requests

Reply via email to