Re: [Zope] exUserFolder and Zope 2.12

2009-12-17 Thread Baiju M
On Thu, Dec 17, 2009 at 10:18 PM, Andrew Milton  wrote:
> +---[ Baiju M ]--
> | Hi,
> |     In exUserFolder there are few exceptions raised like this:
> |
> | raise 'LoginRequired', self.docLogin(self, request)
> |
> | This will not working in Zope 2.12 (Python 2.6)
> |
> | Any idea, how to change it ?
>
> Replace the raise with;
>
> request.RESPONSE.setStatus(401)
> request.RESPONSE.setHeader('Content-Type','text/html')
> request.RESPONSE.write(self.docLogin(self,request))

Thank you very much, this works !

Regards,
Baiju M
___
Zope maillist  -  Zope@zope.org
https://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] exUserFolder and Zope 2.12

2009-12-17 Thread Andrew Milton
+---[ Baiju M ]--
| Hi,
| In exUserFolder there are few exceptions raised like this:
| 
| raise 'LoginRequired', self.docLogin(self, request)
| 
| This will not working in Zope 2.12 (Python 2.6)
| 
| Any idea, how to change it ?

Replace the raise with;

request.RESPONSE.setStatus(401)
request.RESPONSE.setHeader('Content-Type','text/html')
request.RESPONSE.write(self.docLogin(self,request))

-- 
Andrew Milton
a...@theinternet.com.au
___
Zope maillist  -  Zope@zope.org
https://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope-dev )


[Zope] exUserFolder and Zope 2.12

2009-12-17 Thread Baiju M
Hi,
In exUserFolder there are few exceptions raised like this:

raise 'LoginRequired', self.docLogin(self, request)

This will not working in Zope 2.12 (Python 2.6)

Any idea, how to change it ?

Regards,
Baiju M
___
Zope maillist  -  Zope@zope.org
https://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] SQL Method running twice

2009-12-17 Thread Sascha Welter
(Tue, Dec 15, 2009 at 02:10:17PM -0600) Justin Dunsworth wrote/schrieb/egrapse:
> I simplified a page and all it's dependencies and added code back one by
> one. It eventually ended up coming down to one tag that was switching
> browser modes and POSTed twice. Switched compatability mode to on with IE8
> and did it with the same tag and it worked fine.
> 
> I removed the tag:  http://www.w3.org/TR/html4/strict.dtd";>

Your document did not comply to what IE8 expects in a HTML 4.01 strict
document. So it goes to "quirks mode" and in its glorious stupidity
reloads the page to do so.

Two things come to mind:

- don't remove the docstring, switch to the correct one - search the
  Intarweb thing for the correct one for IE8 "compatibility mode" and of
  course for your html

- I guess if the request leading to the zsql method that changed things
  in the database was called through a form (and not as a plain link)
  then maybe IE8 wouldn't try to reload

Good luck in any case!

Regards,

Sascha

___
Zope maillist  -  Zope@zope.org
https://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope-dev )