using decorators with controllers

2007-06-17 Thread voltron
I am having problems using decorators with controllers. In a test controller: # testcontroller.py def dec(func): # do lotsa things print im doing something finished = True if finished: func() # call the function you were decorating class HomeController(BaseController):

Re: using decorators with controllers

2007-06-17 Thread Christoph Haas
On Sun, Jun 17, 2007 at 12:47:47AM -0700, voltron wrote: I am having problems using decorators with controllers. In a test controller: # testcontroller.py def dec(func): # do lotsa things print im doing something finished = True if finished: func() # call the

Re: using decorators with controllers

2007-06-17 Thread voltron
slight mixup, the function dec should read: def dec(func): # do lotsa things print im doing something finished = True if finished: func() this function then uses request.environ['REFERER'] to call the function it was were decorating, in this case, test On Jun 17,

Re: using decorators with controllers

2007-06-17 Thread voltron
ok, I think I´m onto something: def dec(func): def wrapper(*vars): print About to call decorated function %s. % func.func_name print request.environ[HTTP_REFERER] return render_response(request.environ[HTTP_REFERER]) print decorator return wrapper this tries

Global Authkit app protection

2007-06-17 Thread Jose Figueras
Following Authkit with Pylons article (and a mixture of other articles, docs, etc) If I try to protect my whole application I see this strange error: exceptions.AssertionError: Forwarding loop detected; '/signin' visited twice (internal redirect path: ['/public', '/signin']) . But WSGI chain

Re: Global Authkit app protection

2007-06-17 Thread Christoph Haas
On Sun, Jun 17, 2007 at 10:01:24AM -, Jose Figueras wrote: Following Authkit with Pylons article (and a mixture of other articles, docs, etc) If I try to protect my whole application I see this strange error: exceptions.AssertionError: Forwarding loop detected; '/signin' visited twice

Re: using decorators with controllers

2007-06-17 Thread pv
On 17 kesä, 10:47, voltron [EMAIL PROTECTED] wrote: I am having problems using decorators with controllers. In a test controller: [clip] I have to pass self to the function passed to the decorator somehow, what would be the best way to do this? I want the decorator to carry out a few things

Re: using decorators with controllers

2007-06-17 Thread Mike Orr
On 6/17/07, voltron [EMAIL PROTECTED] wrote: ok, I think I´m onto something: def dec(func): def wrapper(*vars): print About to call decorated function %s. % func.func_name print request.environ[HTTP_REFERER] return

Re: [Paste] Use of egg files is confusing

2007-06-17 Thread Mike Orr
On 6/17/07, Ian Bicking [EMAIL PROTECTED] wrote: Noah Slater wrote: Hello, When creating a configuration file, the documentation gives this as an example: use = egg:Paste#urlmap What does egg:Paste#urlmap point to? From the documentation it says: egg:Paste#urlmap means to

Re: using decorators with controllers

2007-06-17 Thread voltron
I took a break and later re-read what you guys wrote instead of the trial and error stance I took, thanks Mike and PV, I have a better understanding of decorators now :-)) I still have to figure out rendering templates from the decorator though, using render _response for my templates does not

Re: Global Authkit app protection

2007-06-17 Thread Christoph Haas
On Sun, Jun 17, 2007 at 09:03:42PM -, Jose Figueras wrote: On 17 jun, 13:22, Christoph Haas [EMAIL PROTECTED] wrote: On Sun, Jun 17, 2007 at 10:01:24AM -, Jose Figueras wrote: Following Authkit with Pylons article (and a mixture of other articles, docs, etc) If I try to protect

using the fckeditor with Pylons

2007-06-17 Thread Jose Galvez
Has anyone used the fckeditor (http://www.fckeditor.net/) with pylons? I've got a project that requires my users to entry data which is more complicated then what can be handled by simple text boxes, due to user formating. I've decided to use the FCKeditor to get the data, but integrating it