[Zope3-Users] z3c.form query widget

2008-04-10 Thread Malthe Borch
I've searched and not found a z3c.form-widget that can support a source that supports text queries (a la Plone's uberselectionwidget). The spec is not defined in Zope, but it's basically: class IQuerySource(ISource): def search(query_string): Return values that matches query.

AW: [Zope3-Users] z3c.form query widget

2008-04-10 Thread Roger Ineichen
Hi Malte Betreff: [Zope3-Users] z3c.form query widget I've searched and not found a z3c.form-widget that can support a source that supports text queries (a la Plone's uberselectionwidget). The spec is not defined in Zope, but it's basically: class IQuerySource(ISource):

AW: [Zope3-Users] Weird behaviour of ViewPageTemplateFile()

2008-04-10 Thread Roger Ineichen
Hi Martin Betreff: [Zope3-Users] Weird behaviour of ViewPageTemplateFile() I just stumbled over something that utterly baffles me and hope someone can point out the absolutely obvious to me. I've got a view defined in a configure.zcml that points to this class: class

Re: [Zope3-Users] Weird behaviour of ViewPageTemplateFile()

2008-04-10 Thread Martin J. Laubach
class MyView(BrowserView): def __call__(self): pt = ViewPageTemplateFile('empty.pt') data = pt() return data try this: pt = ViewPageTemplateFile('empty.pt') return pt(self) Nope, same result: AttributeError: 'str' object has no

Re: [Zope3-Users] Weird behaviour of ViewPageTemplateFile()

2008-04-10 Thread Albertas Agejevas
On Thu, Apr 10, 2008 at 03:22:33PM +0200, Martin J. Laubach wrote: That works fine. However, I don't really need pt as instance variable, so I turned it into a local variable: class MyView(BrowserView): def __call__(self): pt = ViewPageTemplateFile('empty.pt')

Re: [Zope3-Users] Weird behaviour of ViewPageTemplateFile()

2008-04-10 Thread Martin J . Laubach
Well, it's called a *View*PageTemplate for a reason :-) If the file is really empty and you do not need to pass any arguments to it (view, context, request), use a plain PageTemplateFile No, of course it's not empty and it needs the parameters. Nor does the view really look as trivial as

Re: [Zope3-Users] Weird behaviour of ViewPageTemplateFile()

2008-04-10 Thread Albertas Agejevas
On Thu, Apr 10, 2008 at 04:08:43PM +0200, Martin J.Laubach wrote: Well, it's called a *View*PageTemplate for a reason :-) If the file is really empty and you do not need to pass any arguments to it (view, context, request), use a plain PageTemplateFile No, of course it's not empty

Re: [Zope3-Users] Weird behaviour of ViewPageTemplateFile()

2008-04-10 Thread Marius Gedminas
Hi! On Thu, Apr 10, 2008 at 03:22:33PM +0200, Martin J. Laubach wrote: I just stumbled over something that utterly baffles me and hope someone can point out the absolutely obvious to me. Sure. I've got a view defined in a configure.zcml that points to this class: class

Re: [Zope3-Users] Weird behaviour of ViewPageTemplateFile()

2008-04-10 Thread Martin J . Laubach
ViewPageTemplate must be in the view's namespace, and it magically fishes out the view, view's context and request, and makes them available in the TAL namespace. Ah, so there _IS_ heavy magic involved here. Thanks for clarifying that, I was already doubting my sanity! Cheers,

Re: [Zope3-Users] Weird behaviour of ViewPageTemplateFile()

2008-04-10 Thread Jim Fulton
On Apr 10, 2008, at 10:30 AM, Marius Gedminas wrote: I've got a view defined in a configure.zcml that points to this class: class MyView(BrowserView): def __call__(self): self.pt = ViewPageTemplateFile('empty.pt') data = self.pt() return data

Re: [Zope3-Users] Weird behaviour of ViewPageTemplateFile()

2008-04-10 Thread Martin J. Laubach
ViewPageTemplate must be in the view's namespace, and it magically fishes out the view, view's context and request, and makes them available in the TAL namespace. Ah, so there _IS_ heavy magic involved here. Thanks for clarifying that, I was already doubting my sanity! This is exactly the

Re: [Zope3-Users] Weird behaviour of ViewPageTemplateFile()

2008-04-10 Thread Jim Fulton
On Apr 10, 2008, at 11:46 AM, Martin J.Laubach wrote: ViewPageTemplate must be in the view's namespace, and it magically fishes out the view, view's context and request, and makes them available in the TAL namespace. Ah, so there _IS_ heavy magic involved here. Thanks for clarifying that,

Re: [Zope3-Users] Weird behaviour of ViewPageTemplateFile()

2008-04-10 Thread Fred Drake
On Thu, Apr 10, 2008 at 2:59 PM, Martin J. Laubach [EMAIL PROTECTED] wrote: Perhaps I need a radically different approach? Sounds like you want PageTemplateFile. -Fred -- Fred L. Drake, Jr. fdrake at gmail.com Chaos is the score upon which reality is written. --Henry Miller

Re: [Zope3-Users] Weird behaviour of ViewPageTemplateFile()

2008-04-10 Thread Jim Fulton
On Apr 10, 2008, at 2:59 PM, Martin J. Laubach wrote: ViewPageTemplate must be in the view's namespace, and it magically fishes out the view, view's context and request, and makes them available in the TAL namespace. Ah, so there _IS_ heavy magic involved here. Thanks for clarifying that, I

Re: [Zope3-Users] different traversing for different users

2008-04-10 Thread garz
i looked through the sources of zope and found out, the desired option should be implemented by zopepublication but it isnt. if im right with this, my solution should be an extended zopepublication with overwritten beforeTraversal-method. there the user is authenticated and right after that i