Re: [ZPT] Strange session behavior with macro-call
Jeff Peterson wrote: Why not just use PAS or Cookie Crumbler? ;-) I guess I could look at that...I am having to authenticate against an existing database of usernames and passwords so I just wrote it myself. Eee gads, if your existing database is relational, SimpleUserFolder makes it trivial and removes the need for all the page template horribleness... Chris -- Simplistix - Content Management, Zope & Python Consulting - http://www.simplistix.co.uk ___ ZPT mailing list ZPT@zope.org http://mail.zope.org/mailman/listinfo/zpt
Re: [ZPT] Strange session behavior with macro-call
Jeff Peterson wrote at 2006-6-26 15:04 -0500: >I have a page template that calls a couple of scripts at the beginning, >they are setting session objects and redirecting to a login screen if >certain session objects don't exist. I am pulling in a macro to display >the content for this page. When the macro is rendered, the scripts fail >to operate properly (commented out they work perfectly). In the error >case the redirect still happens however, none of the session variable >are set. How do you redirect? With "raise 'Redirect'"?. In this case (as in all cases when an exception arrives at the "ZPublisher"), the transaction is aborted and all session modifications are annihilated. -- Dieter ___ ZPT mailing list ZPT@zope.org http://mail.zope.org/mailman/listinfo/zpt
Re: [ZPT] Strange session behavior with macro-call
Chris Withers wrote: Jeff Peterson wrote: I have a page template that calls a couple of scripts at the beginning, they are setting session objects and redirecting to a login screen if certain session objects don't exist. Why not just use PAS or Cookie Crumbler? ;-) I guess I could look at that...I am having to authenticate against an existing database of usernames and passwords so I just wrote it myself. the content for this page. When the macro is rendered, the scripts fail to operate properly (commented out they work perfectly). I'll bet your doing something like: ... The macro replaces the whole tag before the tal:define gets called. Actually I am not doing anything of the sort. The whole page is a macro to start. The scripts that are being called are all in this format: global uadmpython:'uadm' in roles; global dadmpython:'dadm' in roles; global padmpython:'padm' in roles"> then below, the macro is being pulled in inside a different fill-slot. Anyway, overarchingly, don't mix presentation and logic like this, 'cos it causes these kind of problems ;-) cheers, Chris -- Jeffrey D Peterson begin:vcard fn:Jeffrey Peterson n:Peterson;Jeffrey org:Crary Industries;Information Systems adr:;;237 12th Street NW;West Fargo;ND;58078;US email;internet:[EMAIL PROTECTED] title:Web Applications Developer tel;work:701-282-5520 x-mozilla-html:FALSE url:http://crary.com version:2.1 end:vcard ___ ZPT mailing list ZPT@zope.org http://mail.zope.org/mailman/listinfo/zpt
Re: [ZPT] Strange session behavior with macro-call
Jeff Peterson wrote: I have a page template that calls a couple of scripts at the beginning, they are setting session objects and redirecting to a login screen if certain session objects don't exist. Why not just use PAS or Cookie Crumbler? ;-) the content for this page. When the macro is rendered, the scripts fail to operate properly (commented out they work perfectly). I'll bet your doing something like: ... The macro replaces the whole tag before the tal:define gets called. Anyway, overarchingly, don't mix presentation and logic like this, 'cos it causes these kind of problems ;-) cheers, Chris -- Simplistix - Content Management, Zope & Python Consulting - http://www.simplistix.co.uk ___ ZPT mailing list ZPT@zope.org http://mail.zope.org/mailman/listinfo/zpt
[ZPT] Strange session behavior with macro-call
I have a page template that calls a couple of scripts at the beginning, they are setting session objects and redirecting to a login screen if certain session objects don't exist. I am pulling in a macro to display the content for this page. When the macro is rendered, the scripts fail to operate properly (commented out they work perfectly). In the error case the redirect still happens however, none of the session variable are set. I test it with other markup in place of the macro and it works, I make that code into a macro and that works as well I am scratching my head furiously with this one, any help would be appreciated. Regards, -- Jeffrey D Peterson begin:vcard fn:Jeffrey Peterson n:Peterson;Jeffrey org:Crary Industries;Information Systems adr:;;237 12th Street NW;West Fargo;ND;58078;US email;internet:[EMAIL PROTECTED] title:Web Applications Developer tel;work:701-282-5520 x-mozilla-html:FALSE url:http://crary.com version:2.1 end:vcard ___ ZPT mailing list ZPT@zope.org http://mail.zope.org/mailman/listinfo/zpt