On Sep 24, 2006, at 1:41 PM, Tom Lazar wrote:
On Sep 24, 2006, at 1:25 AM, Martin Aspeli wrote:
o Looking at http://dev.plone.org/archetypes/changeset/6957, it's
not clear to me why we need to set the field's allowable content
types from the site property that holds the default values as
managed by the configlet.
that's because every other piece of code dealing with this
information expects it to reside there (i.e. as a property of the
schema). this plip is not so much about changing the lookup of this
value but about enabling the user to set a default for it via a
control panel. besides, this value is only relevant upon creation
of an instance, so on a conceptual level, subsequent changes of the
site-wide default wouldn't affect exsting instances anyway.
duh! i didn't read your comment properly the first time. indeed, i
think you're right: i can't think of a good reason why to store the
'allowable content types' in the schema any longer, since one of the
main goals of this plip is to remove the dependency on this field in
the first place ;-)
i.e. *theoretically* all relevant pieces of code already consult the
site-wide list instead of the property. however, after i've removed
this bit, i get failing tests, see sample output below.
right now i haven't got time to look at that more closely, so will
just leave that bit in for now.
cheers,
tom
Error in test testRendering
(Products.Archetypes.tests.test_cmfessentials.TestPermissions)
Traceback (most recent call last):
File "/opt/zope/Zope210-branch/lib/python/Testing/ZopeTestCase/
profiler.py", line 98, in __call__
testMethod()
File "test_cmfessentials.py", line 73, in testRendering
File "/Data/opt/zope/instances/plip149/zope/Products/Archetypes/
TemplateMixin.py", line 68, in __call__
File "/Data/opt/zope/instances/plip149/zope/Products/
CMFFormController/FSControllerPageTemplate.py", line 96, in __call__
File "/Data/opt/zope/instances/plip149/zope/Products/
CMFFormController/BaseControllerPageTemplate.py", line 42, in _call
File "/opt/zope/Zope210-branch/lib/python/Shared/DC/Scripts/
Bindings.py", line 313, in __call__
return self._bindAndExec(args, kw, None)
File "/opt/zope/Zope210-branch/lib/python/Shared/DC/Scripts/
Bindings.py", line 350, in _bindAndExec
return self._exec(bound_data, args, kw)
File "/Data/opt/zope/instances/plip149/zope/Products/CMFCore/
FSPageTemplate.py", line 195, in _exec
File "/Data/opt/zope/instances/plip149/zope/Products/CMFCore/
FSPageTemplate.py", line 134, in pt_render
File "/opt/zope/Zope210-branch/lib/python/Products/PageTemplates/
PageTemplate.py", line 89, in pt_render
return super(PageTemplate, self).pt_render(c, source=source)
File "/opt/zope/Zope210-branch/lib/python/zope/pagetemplate/
pagetemplate.py", line 117, in pt_render
strictinsert=0, sourceAnnotations=sourceAnnotations)()
File "/opt/zope/Zope210-branch/lib/python/zope/tal/
talinterpreter.py", line 271, in __call__
self.interpret(self.program)
File "/opt/zope/Zope210-branch/lib/python/zope/tal/
talinterpreter.py", line 346, in interpret
handlers[opcode](self, args)
File "/opt/zope/Zope210-branch/lib/python/zope/tal/
talinterpreter.py", line 861, in do_defineMacro
self.interpret(macro)
File "/opt/zope/Zope210-branch/lib/python/zope/tal/
talinterpreter.py", line 346, in interpret
handlers[opcode](self, args)
File "/opt/zope/Zope210-branch/lib/python/zope/tal/
talinterpreter.py", line 536, in do_optTag_tal
self.do_optTag(stuff)
File "/opt/zope/Zope210-branch/lib/python/zope/tal/
talinterpreter.py", line 521, in do_optTag
return self.no_tag(start, program)
File "/opt/zope/Zope210-branch/lib/python/zope/tal/
talinterpreter.py", line 516, in no_tag
self.interpret(program)
File "/opt/zope/Zope210-branch/lib/python/zope/tal/
talinterpreter.py", line 346, in interpret
handlers[opcode](self, args)
File "/opt/zope/Zope210-branch/lib/python/zope/tal/
talinterpreter.py", line 891, in do_useMacro
self.interpret(macro)
File "/opt/zope/Zope210-branch/lib/python/zope/tal/
talinterpreter.py", line 346, in interpret
handlers[opcode](self, args)
File "/opt/zope/Zope210-branch/lib/python/zope/tal/
talinterpreter.py", line 536, in do_optTag_tal
self.do_optTag(stuff)
File "/opt/zope/Zope210-branch/lib/python/zope/tal/
talinterpreter.py", line 521, in do_optTag
return self.no_tag(start, program)
File "/opt/zope/Zope210-branch/lib/python/zope/tal/
talinterpreter.py", line 516, in no_tag
self.interpret(program)
File "/opt/zope/Zope210-branch/lib/python/zope/tal/
talinterpreter.py", line 346, in interpret
handlers[opcode](self, args)
File "/opt/zope/Zope210-branch/lib/python/zope/tal/
talinterpreter.py", line 961, in do_defineSlot
self.interpret(block)
File "/opt/zope/Zope210-branch/lib/python/zope/tal/
talinterpreter.py", line 346, in interpret
handlers[opcode](self, args)
File "/opt/zope/Zope210-branch/lib/python/zope/tal/
talinterpreter.py", line 536, in do_optTag_tal
self.do_optTag(stuff)
File "/opt/zope/Zope210-branch/lib/python/zope/tal/
talinterpreter.py", line 521, in do_optTag
return self.no_tag(start, program)
File "/opt/zope/Zope210-branch/lib/python/zope/tal/
talinterpreter.py", line 516, in no_tag
self.interpret(program)
File "/opt/zope/Zope210-branch/lib/python/zope/tal/
talinterpreter.py", line 346, in interpret
handlers[opcode](self, args)
File "/opt/zope/Zope210-branch/lib/python/zope/tal/
talinterpreter.py", line 861, in do_defineMacro
self.interpret(macro)
File "/opt/zope/Zope210-branch/lib/python/zope/tal/
talinterpreter.py", line 346, in interpret
handlers[opcode](self, args)
File "/opt/zope/Zope210-branch/lib/python/zope/tal/
talinterpreter.py", line 950, in do_defineSlot
self.interpret(slot)
File "/opt/zope/Zope210-branch/lib/python/zope/tal/
talinterpreter.py", line 346, in interpret
handlers[opcode](self, args)
File "/opt/zope/Zope210-branch/lib/python/zope/tal/
talinterpreter.py", line 536, in do_optTag_tal
self.do_optTag(stuff)
File "/opt/zope/Zope210-branch/lib/python/zope/tal/
talinterpreter.py", line 521, in do_optTag
return self.no_tag(start, program)
File "/opt/zope/Zope210-branch/lib/python/zope/tal/
talinterpreter.py", line 516, in no_tag
self.interpret(program)
File "/opt/zope/Zope210-branch/lib/python/zope/tal/
talinterpreter.py", line 346, in interpret
handlers[opcode](self, args)
File "/opt/zope/Zope210-branch/lib/python/zope/tal/
talinterpreter.py", line 861, in do_defineMacro
self.interpret(macro)
File "/opt/zope/Zope210-branch/lib/python/zope/tal/
talinterpreter.py", line 346, in interpret
handlers[opcode](self, args)
File "/opt/zope/Zope210-branch/lib/python/zope/tal/
talinterpreter.py", line 536, in do_optTag_tal
self.do_optTag(stuff)
File "/opt/zope/Zope210-branch/lib/python/zope/tal/
talinterpreter.py", line 521, in do_optTag
return self.no_tag(start, program)
File "/opt/zope/Zope210-branch/lib/python/zope/tal/
talinterpreter.py", line 516, in no_tag
self.interpret(program)
File "/opt/zope/Zope210-branch/lib/python/zope/tal/
talinterpreter.py", line 346, in interpret
handlers[opcode](self, args)
File "/opt/zope/Zope210-branch/lib/python/zope/tal/
talinterpreter.py", line 891, in do_useMacro
self.interpret(macro)
File "/opt/zope/Zope210-branch/lib/python/zope/tal/
talinterpreter.py", line 346, in interpret
handlers[opcode](self, args)
File "/opt/zope/Zope210-branch/lib/python/zope/tal/
talinterpreter.py", line 961, in do_defineSlot
self.interpret(block)
File "/opt/zope/Zope210-branch/lib/python/zope/tal/
talinterpreter.py", line 346, in interpret
handlers[opcode](self, args)
File "/opt/zope/Zope210-branch/lib/python/zope/tal/
talinterpreter.py", line 536, in do_optTag_tal
self.do_optTag(stuff)
File "/opt/zope/Zope210-branch/lib/python/zope/tal/
talinterpreter.py", line 521, in do_optTag
return self.no_tag(start, program)
File "/opt/zope/Zope210-branch/lib/python/zope/tal/
talinterpreter.py", line 516, in no_tag
self.interpret(program)
File "/opt/zope/Zope210-branch/lib/python/zope/tal/
talinterpreter.py", line 346, in interpret
handlers[opcode](self, args)
File "/opt/zope/Zope210-branch/lib/python/zope/tal/
talinterpreter.py", line 824, in do_loop_tal
self.interpret(block)
File "/opt/zope/Zope210-branch/lib/python/zope/tal/
talinterpreter.py", line 346, in interpret
handlers[opcode](self, args)
File "/opt/zope/Zope210-branch/lib/python/zope/tal/
talinterpreter.py", line 536, in do_optTag_tal
self.do_optTag(stuff)
File "/opt/zope/Zope210-branch/lib/python/zope/tal/
talinterpreter.py", line 521, in do_optTag
return self.no_tag(start, program)
File "/opt/zope/Zope210-branch/lib/python/zope/tal/
talinterpreter.py", line 516, in no_tag
self.interpret(program)
File "/opt/zope/Zope210-branch/lib/python/zope/tal/
talinterpreter.py", line 346, in interpret
handlers[opcode](self, args)
File "/opt/zope/Zope210-branch/lib/python/zope/tal/
talinterpreter.py", line 891, in do_useMacro
self.interpret(macro)
File "/opt/zope/Zope210-branch/lib/python/zope/tal/
talinterpreter.py", line 346, in interpret
handlers[opcode](self, args)
File "/opt/zope/Zope210-branch/lib/python/zope/tal/
talinterpreter.py", line 536, in do_optTag_tal
self.do_optTag(stuff)
File "/opt/zope/Zope210-branch/lib/python/zope/tal/
talinterpreter.py", line 521, in do_optTag
return self.no_tag(start, program)
File "/opt/zope/Zope210-branch/lib/python/zope/tal/
talinterpreter.py", line 516, in no_tag
self.interpret(program)
File "/opt/zope/Zope210-branch/lib/python/zope/tal/
talinterpreter.py", line 346, in interpret
handlers[opcode](self, args)
File "/opt/zope/Zope210-branch/lib/python/zope/tal/
talinterpreter.py", line 891, in do_useMacro
self.interpret(macro)
File "/opt/zope/Zope210-branch/lib/python/zope/tal/
talinterpreter.py", line 346, in interpret
handlers[opcode](self, args)
File "/opt/zope/Zope210-branch/lib/python/zope/tal/
talinterpreter.py", line 536, in do_optTag_tal
self.do_optTag(stuff)
File "/opt/zope/Zope210-branch/lib/python/zope/tal/
talinterpreter.py", line 521, in do_optTag
return self.no_tag(start, program)
File "/opt/zope/Zope210-branch/lib/python/zope/tal/
talinterpreter.py", line 516, in no_tag
self.interpret(program)
File "/opt/zope/Zope210-branch/lib/python/zope/tal/
talinterpreter.py", line 346, in interpret
handlers[opcode](self, args)
File "/opt/zope/Zope210-branch/lib/python/zope/tal/
talinterpreter.py", line 855, in do_condition
self.interpret(block)
File "/opt/zope/Zope210-branch/lib/python/zope/tal/
talinterpreter.py", line 346, in interpret
handlers[opcode](self, args)
File "/opt/zope/Zope210-branch/lib/python/zope/tal/
talinterpreter.py", line 536, in do_optTag_tal
self.do_optTag(stuff)
File "/opt/zope/Zope210-branch/lib/python/zope/tal/
talinterpreter.py", line 521, in do_optTag
return self.no_tag(start, program)
File "/opt/zope/Zope210-branch/lib/python/zope/tal/
talinterpreter.py", line 516, in no_tag
self.interpret(program)
File "/opt/zope/Zope210-branch/lib/python/zope/tal/
talinterpreter.py", line 346, in interpret
handlers[opcode](self, args)
File "/opt/zope/Zope210-branch/lib/python/zope/tal/
talinterpreter.py", line 855, in do_condition
self.interpret(block)
File "/opt/zope/Zope210-branch/lib/python/zope/tal/
talinterpreter.py", line 346, in interpret
handlers[opcode](self, args)
File "/opt/zope/Zope210-branch/lib/python/zope/tal/
talinterpreter.py", line 534, in do_optTag_tal
self.no_tag(stuff[-2], stuff[-1])
File "/opt/zope/Zope210-branch/lib/python/zope/tal/
talinterpreter.py", line 516, in no_tag
self.interpret(program)
File "/opt/zope/Zope210-branch/lib/python/zope/tal/
talinterpreter.py", line 346, in interpret
handlers[opcode](self, args)
File "/opt/zope/Zope210-branch/lib/python/zope/tal/
talinterpreter.py", line 950, in do_defineSlot
self.interpret(slot)
File "/opt/zope/Zope210-branch/lib/python/zope/tal/
talinterpreter.py", line 346, in interpret
handlers[opcode](self, args)
File "/opt/zope/Zope210-branch/lib/python/zope/tal/
talinterpreter.py", line 536, in do_optTag_tal
self.do_optTag(stuff)
File "/opt/zope/Zope210-branch/lib/python/zope/tal/
talinterpreter.py", line 521, in do_optTag
return self.no_tag(start, program)
File "/opt/zope/Zope210-branch/lib/python/zope/tal/
talinterpreter.py", line 516, in no_tag
self.interpret(program)
File "/opt/zope/Zope210-branch/lib/python/zope/tal/
talinterpreter.py", line 346, in interpret
handlers[opcode](self, args)
File "/opt/zope/Zope210-branch/lib/python/zope/tal/
talinterpreter.py", line 891, in do_useMacro
self.interpret(macro)
File "/opt/zope/Zope210-branch/lib/python/zope/tal/
talinterpreter.py", line 346, in interpret
handlers[opcode](self, args)
File "/opt/zope/Zope210-branch/lib/python/zope/tal/
talinterpreter.py", line 536, in do_optTag_tal
self.do_optTag(stuff)
File "/opt/zope/Zope210-branch/lib/python/zope/tal/
talinterpreter.py", line 521, in do_optTag
return self.no_tag(start, program)
File "/opt/zope/Zope210-branch/lib/python/zope/tal/
talinterpreter.py", line 516, in no_tag
self.interpret(program)
File "/opt/zope/Zope210-branch/lib/python/zope/tal/
talinterpreter.py", line 346, in interpret
handlers[opcode](self, args)
File "/opt/zope/Zope210-branch/lib/python/zope/tal/
talinterpreter.py", line 586, in do_setLocal_tal
self.engine.setLocal(name, self.engine.evaluateValue(expr))
File "/opt/zope/Zope210-branch/lib/python/zope/tales/tales.py",
line 696, in evaluate
return expression(self)
File "/opt/zope/Zope210-branch/lib/python/Products/PageTemplates/
ZRPythonExpr.py", line 43, in __call__
return eval(self._code, vars, {})
File "Python expression "[t for t in allowable_ct if t.startswith
('text/')]"", line 1, in <expression>
File "/opt/zope/Zope210-branch/lib/python/AccessControl/
ZopeGuards.py", line 201, in guarded_iter
return SafeIter(i)
File "/opt/zope/Zope210-branch/lib/python/AccessControl/
ZopeGuards.py", line 171, in __init__
self._next = iter(ob).next
TypeError: iteration over non-sequence
_______________________________________________
Framework-Team mailing list
Framework-Team@lists.plone.org
http://lists.plone.org/mailman/listinfo/framework-team