[Zope] Intercept request

2008-01-07 Thread David Chelimsky
Hi, I want to show different things to different viewers based on their IP addresses. How can I do this? Cheers, David ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related

Re: [Zope] Intercept request

2008-01-07 Thread Andreas Jung
--On 7. Januar 2008 08:00:27 -0600 David Chelimsky [EMAIL PROTECTED] wrote: Hi, I want to show different things to different viewers based on their IP addresses. How can I do this? Basically you look at the clients ip address (from the REQUEST object) and perform any action you need

Re: [Zope] Intercept request

2008-01-07 Thread David Chelimsky
On Jan 7, 2008 8:06 AM, Andreas Jung [EMAIL PROTECTED] wrote: --On 7. Januar 2008 08:00:27 -0600 David Chelimsky [EMAIL PROTECTED] wrote: Hi, I want to show different things to different viewers based on their IP addresses. How can I do this? Basically you look at the clients ip

Re: [Zope] Intercept request

2008-01-07 Thread Tom Von Lahndorff
On Jan 7, 2008, at 9:00 AM, David Chelimsky wrote: Hi, I want to show different things to different viewers based on their IP addresses. How can I do this? Cheers, David swap out theipaddress with the actual IP. dtml-if REMOTE_ADDR == 'theipaddress' true dtml-elif HTTP_X_FORWARDED_FOR ==

Re: [Zope] Intercept request

2008-01-07 Thread Andreas Jung
--On 7. Januar 2008 08:18:14 -0600 David Chelimsky [EMAIL PROTECTED] wrote: On Jan 7, 2008 8:06 AM, Andreas Jung [EMAIL PROTECTED] wrote: --On 7. Januar 2008 08:00:27 -0600 David Chelimsky [EMAIL PROTECTED] wrote: Hi, I want to show different things to different viewers based on their

Re: [Zope] Intercept request

2008-01-07 Thread Tom Von Lahndorff
On Jan 7, 2008, at 9:18 AM, David Chelimsky wrote: On Jan 7, 2008 8:06 AM, Andreas Jung [EMAIL PROTECTED] wrote: --On 7. Januar 2008 08:00:27 -0600 David Chelimsky [EMAIL PROTECTED] wrote: Hi, I want to show different things to different viewers based on their IP addresses. How can I

Re: [Zope] Intercept request

2008-01-07 Thread David Chelimsky
On Jan 7, 2008 8:23 AM, Andreas Jung [EMAIL PROTECTED] wrote: --On 7. Januar 2008 08:18:14 -0600 David Chelimsky [EMAIL PROTECTED] wrote: On Jan 7, 2008 8:06 AM, Andreas Jung [EMAIL PROTECTED] wrote: --On 7. Januar 2008 08:00:27 -0600 David Chelimsky [EMAIL PROTECTED] wrote: Hi,

Re: [Zope] Intercept request

2008-01-07 Thread Andreas Jung
--On 7. Januar 2008 08:35:50 -0600 David Chelimsky [EMAIL PROTECTED] wrote: On Jan 7, 2008 8:23 AM, Andreas Jung [EMAIL PROTECTED] wrote: --On 7. Januar 2008 08:18:14 -0600 David Chelimsky [EMAIL PROTECTED] wrote: On Jan 7, 2008 8:06 AM, Andreas Jung [EMAIL PROTECTED] wrote: --On 7.

Re: [Zope] Intercept request

2008-01-07 Thread Andrew Milton
+---[ Andreas Jung ]-- | | This issue is a configuration and not an application issue. So it basically | does not belong into Zope. That's a pretty narrow view in my opinion. We nearly all already display different content to different classes of user, I fail to see how

Re: [Zope] Intercept request

2008-01-07 Thread Andreas Jung
--On 8. Januar 2008 01:49:21 +1100 Andrew Milton [EMAIL PROTECTED] wrote: +---[ Andreas Jung ]-- | | This issue is a configuration and not an application issue. So it | basically does not belong into Zope. That's a pretty narrow view in my opinion. We nearly all

[Zope] Re: Intercept request

2008-01-07 Thread Josef Meile
BTW - I'm using ZPT, not DTML. I'm guessing I can do this with a simple script that I include on every page, yes? That could work, but seems a bit error prone - that's why I'm looking for some sort of request hook. But maybe that's my best option within Zope. Thoughts? I guess if you want to do

[Zope] Re: Intercept request

2008-01-07 Thread Raphael Ritz
David Chelimsky wrote: [..] BTW - I'm using ZPT, not DTML. I'm guessing I can do this with a simple script that I include on every page, yes? That could work, but seems a bit error prone - that's why I'm looking for some sort of request hook. But maybe that's my best option within Zope.

Re: [Zope] Intercept request

2008-01-07 Thread David Chelimsky
On Jan 7, 2008 8:35 AM, David Chelimsky [EMAIL PROTECTED] wrote: On Jan 7, 2008 8:23 AM, Andreas Jung [EMAIL PROTECTED] wrote: --On 7. Januar 2008 08:18:14 -0600 David Chelimsky [EMAIL PROTECTED] wrote: On Jan 7, 2008 8:06 AM, Andreas Jung [EMAIL PROTECTED] wrote: --On 7. Januar

[Zope] Re: Intercept request

2008-01-07 Thread Josef Meile
Raphael Ritz schrieb: David Chelimsky wrote: [..] BTW - I'm using ZPT, not DTML. I'm guessing I can do this with a simple script that I include on every page, yes? That could work, but seems a bit error prone - that's why I'm looking for some sort of request hook. But maybe that's my best

[Zope] can't pickle instancemethod objects in testcase

2008-01-07 Thread Peter Bengtsson
My code works fine in normal running zope but not when run as a testcase (I'm not using bin/zopectl test if that matters) I get the following error. I feel guilty since I've got this line in my code: transaction.get().commit() (Expense.py#4458) I remember having come across this error before

Re: [Zope] can't pickle instancemethod objects in testcase

2008-01-07 Thread Andreas Jung
--On 7. Januar 2008 18:29:50 + Peter Bengtsson [EMAIL PROTECTED] wrote: My code works fine in normal running zope but not when run as a testcase (I'm not using bin/zopectl test if that matters) I get the following error. I feel guilty since I've got this line in my code:

Re: [Zope] can't pickle instancemethod objects in testcase

2008-01-07 Thread Peter Bengtsson
Andreas Jung wrote: --On 7. Januar 2008 18:29:50 + Peter Bengtsson [EMAIL PROTECTED] wrote: My code works fine in normal running zope but not when run as a testcase (I'm not using bin/zopectl test if that matters) I get the following error. I feel guilty since I've got this line in

Re: [Zope] Intercept request

2008-01-07 Thread Dieter Maurer
Andreas Jung wrote at 2008-1-7 16:04 +0100: Narrow or not..it does not belong into directly in Zope in my opinion. If you were using Plone for example as CMS, you could create your PAS plugin providing dedicated roles for different IP ranges (or something similar) and control the

Re: [Zope] Re: Intercept request

2008-01-07 Thread Dieter Maurer
Raphael Ritz wrote at 2008-1-7 16:16 +0100: David Chelimsky wrote: [..] BTW - I'm using ZPT, not DTML. I'm guessing I can do this with a simple script that I include on every page, yes? That could work, but seems a bit error prone - that's why I'm looking for some sort of request hook. But

Re: [Zope] can't pickle instancemethod objects in testcase

2008-01-07 Thread Andreas Jung
--On 7. Januar 2008 19:17:06 + Peter Bengtsson [EMAIL PROTECTED] wrote: Damn it! Not the answer I was hoping for. I was hoping for something simpler and more obvious :) What object do you suggest I inspect in the debugger then? I don't know how the ZODB figures out what it needs to save.

[Zope] Using md5 with allow_module

2008-01-07 Thread Running Clam
Hi, I have a need to generate an md5 hash for an XML fragment generated by TTW Zope code. I thought I could do this with allow_module - I have a pseudo-product with an __init_,py that contains: - # Global module assertions for Python scripts from Products.PythonScripts.Utility import

Re: [Zope] Using md5 with allow_module

2008-01-07 Thread Andreas Jung
--On 7. Januar 2008 21:10:32 + Running Clam [EMAIL PROTECTED] wrote: Hi, I have a need to generate an md5 hash for an XML fragment generated by TTW Zope code. Error Type: Unauthorized Error Value: The container has no security assertions. Access to 'update' of (md5.md5 object at

Re: [Zope] Using md5 with allow_module

2008-01-07 Thread Running Clam
Hi All, Sorry Andreas - I hit reply instead of reply-all, and sent my response only to you. Thanks for your reply. On 1/8/08, Andreas Jung [EMAIL PROTECTED] wrote: FAQ! Yes, there have been a good few questions about this - I spent a lot of time googling yesterday, and found a couple of

Re: [Zope] Using md5 with allow_module

2008-01-07 Thread Andreas Jung
--On 8. Januar 2008 06:47:37 + Running Clam [EMAIL PROTECTED] wrote: I understand that an external method or a product are my other choices, but I'm really uncomfortable about not understanding how I can tell when I can and when I cannot use allow_module() - at the moment, this feels

[Zope-dev] Zope Tests: 4 OK, 1 Failed

2008-01-07 Thread Zope Tests Summarizer
Summary of messages to the zope-tests list. Period Sun Jan 6 12:00:00 2008 UTC to Mon Jan 7 12:00:00 2008 UTC. There were 5 messages: 5 from Zope Unit Tests. Test failures - Subject: FAILED (failures=1) : Zope-trunk Python-2.4.4 : Linux From: Zope Unit Tests Date: Sun Jan 6

[Zope-dev] zope.interface confuses Python

2008-01-07 Thread Dieter Maurer
Yesterday, I released dm.zdoc and today I find problems. The analysis revealed: The class webdav.EtagSupport.EtagSupport has initially no attributes __provides__ and __providedBy__. For still unknown reasons, it suddenly gets these attributes. __provides__ is a

[zope.interface bug] Re: [Zope-dev] zope.interface confuses Python

2008-01-07 Thread Dieter Maurer
Dieter Maurer wrote at 2008-1-7 17:55 +0100: Yesterday, I released dm.zdoc and today I find problems. The analysis revealed: The class webdav.EtagSupport.EtagSupport has initially no attributes __provides__ and __providedBy__. For still unknown reasons, it suddenly gets these attributes.

Re: [zope.interface bug] Re: [Zope-dev] zope.interface confuses Python

2008-01-07 Thread Jim Fulton
On Jan 7, 2008, at 2:35 PM, Dieter Maurer wrote: Dieter Maurer wrote at 2008-1-7 17:55 +0100: Yesterday, I released dm.zdoc and today I find problems. The analysis revealed: The class webdav.EtagSupport.EtagSupport has initially no attributes __provides__ and __providedBy__. For still

Re: [zope.interface bug] Re: [Zope-dev] zope.interface confuses Python

2008-01-07 Thread Dieter Maurer
Hello Jim, Jim Fulton wrote at 2008-1-7 15:15 -0500: I think I understand the behavior -- and I think it is a zope.interface bug. No, it is intended behavior. Why? ... Under some circumstances zope.interface adds a __provides__ descriptor to a class. The descriptor is

Re: [zope.interface bug] Re: [Zope-dev] zope.interface confuses Python

2008-01-07 Thread Jim Fulton
On Jan 7, 2008, at 3:54 PM, Dieter Maurer wrote: ... Under some circumstances zope.interface adds a __provides__ descriptor to a class. The descriptor is implemented in zope/interface/_zope_interface_coptimizations.c and called CPB_descr_get. While __implements__ is inherited by derived