[Zope] ERROR BeforeTraverse Error while invoking hook

2005-12-19 Thread Maciej Wisniowski

Hi!

After upgrading our Zope instances from Zope 2.7.2 to 2.8.4 we've noticed
new kind of errors in event.log on one of our servers. Error is as follows:

2005-12-19T07:53:59 ERROR BeforeTraverse Error while invoking hook: "input"
Traceback (most recent call last):
 File "/opt/Zope/2.8.4/lib/python/ZPublisher/BeforeTraverse.py", line 
144, in __call__

   meth(*(container, request, None)[:args])
AttributeError: __call__

I've looked into BeforeTraverse.py and I see this error is only logged 
to event.log and
is not visible to the users, and it seems to me that it is something 
with acquisition(?)
I need some hints how to find what causes this error - what has changed 
in 2.8.x and

how to deal with this?
Our application is written in ZODB not in products. There is a folder 
named 'input' in it,

may it be the problem?

--
Maciej Wisniowski

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

http://mail.zope.org/mailman/listinfo/zope-dev )


[Zope] Re: Can't pickle objects in acquisition wrappers

2005-12-19 Thread Florent Guillaume

Keith Alperin wrote:
I'm returning to Zope after about a year away and am working on a  
project that i have pieced together over about 4 years.  I recently  
deployed this project (a family history web site) under a zope 2.7.x  
install (it used to run on a 2.4.x install) and now I can't seem to  
update any of my objects.  when i try to save them, I get a  TypeError: 
Can't pickle objects in acquisition wrappers.  I was never  more than a 
dabbler, so I can't really claim to fully grok what  acquisition 
wrappers are, other than being a construct that allows me  to refer to 
an object in a request without knowing exactly where it  is (ie is it a 
request parameter, a member of my object etc).   Googling for this 
message yields very little information and grepping  the source code 
yields one nondescript (at least to me) line in  _Acquisition.c .  Does 
anyone understand what this error means?  Does  anyone have any ideas on 
how to tell what "acquisition wrapper" i'm  saving?  Is there a way for 
me to workaround this?


In your traceback you should have a call like p.dump(state).
Go edit this file it's in and replace it with code like:
  try:
  p.dump(state)
  except TypeError, e:
  raise TypeError(str(e)+': '+repr(state))

This will give you more info about what fails to be pickled.
Any part of the error where you see a full path (like /some/site/foo>) is with an acquisition wrapper. It shouldn't.


Or you can add a import pdb; pdb.set_trace() there if you know how to use PDB.

Florent

--
Florent Guillaume, Nuxeo (Paris, France)   CTO, Director of R&D
+33 1 40 33 71 59   http://nuxeo.com   [EMAIL PROTECTED]
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )


[Zope] zope 3 on debian sarge

2005-12-19 Thread adeline nombre
can somebody tell me if he has ever run zope 3.0.1 on a debian Sarge. I tried but I found many thing during the "make" step: directories to rename cause of the casse: ZODB...  My coffee is over now because of this.
		 Nouveau : téléphonez moins cher avec Yahoo! Messenger ! Découvez les tarifs exceptionnels pour appeler la France et l'international.
Téléchargez la version beta.___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] batching help

2005-12-19 Thread Nicolas Georgakopoulos
Thanks a lot , I did it with my 'ugly' way but that was exactly what I 
was looking for.


cheers..

Martijn Pieters wrote:


On 12/15/05, Nicolas Georgakopoulos <[EMAIL PROTECTED]> wrote:
 


Hello all , I'm trying to display on the same page a table with (3
columns) with content from a list . I'm trying to batch the results so
that every 3 elements anothe row is created.
Can anyone give me a clue how to do that ?
   



Use batches and the following recipe:

http://zopelabs.com/cookbook/998066576


--
Martijn Pieters
 


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

http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] zope 3 on debian sarge

2005-12-19 Thread Andreas Pakulat
On 19.12.05 13:37:53, adeline nombre wrote:
> can somebody tell me if he has ever run zope 3.0.1 on a debian Sarge. I tried 
> but I found many thing during the "make" step: directories to rename cause of 
> the casse: ZODB...
>   My coffee is over now because of this.

?? Are you using Zope on a FS that doesn't distinguish between upper and
lower case?

What are the exact error messages?

Why don't you use a more recent version of Zope 3? (3.1.0 is current)

Andreas

-- 
All the troubles you have will pass away very quickly.
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] zope and LDAP for authorisation

2005-12-19 Thread Marinussen, M.J. (Ria)
Hi Jens,


> 
> I need the full error traceback to help.
> 

The full traceback on: 
Zope 2.7.2-0, python 2.3.5, win32
LDAPUserFolder 2.6
OpenLDAP 2.3.11 

When I type the correct LDAP password I get this error and traceback
(otherwise I get an "Unauthorized" error).

=
Time 2005/12/19 14:50:33.144 GMT+1 
User Name (User Id) Anonymous User (None) 
Request URL http://localhost:8080/ldaptest/protected_folder/index_html 
Exception Type TypeError 
Exception Value len() of unsized object 

Traceback (innermost last): 

Module ZPublisher.Publish, line 92, in publish 
Module ZPublisher.BaseRequest, line 423, in traverse 
Module AccessControl.User, line 641, in validate 
Module Products.LDAPUserFolder.LDAPUserFolder, line 769, in authenticate

Module Products.LDAPUserFolder.LDAPUserFolder, line 723, in getUser 
Module Products.LDAPUserFolder.LDAPUserFolder, line 678, in
getUserByAttr 
TypeError: len() of unsized object 

=

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


Re: [Zope] zope 3 on debian sarge

2005-12-19 Thread Andreas Pakulat
On 19.12.05 14:16:20, Andreas Pakulat wrote:
> On 19.12.05 13:37:53, adeline nombre wrote:
> > can somebody tell me if he has ever run zope 3.0.1 on a debian Sarge. I 
> > tried but I found many thing during the "make" step: directories to rename 
> > cause of the casse: ZODB...
> >   My coffee is over now because of this.
> 
> ?? Are you using Zope on a FS that doesn't distinguish between upper and
> lower case?
> 
> What are the exact error messages?
> 
> Why don't you use a more recent version of Zope 3? (3.1.0 is current)

BTW: Just installed Zope 3.1.0 on my Sarge box using configure; make;
make install. Worked like a charme.

Andreas

-- 
Don't hate yourself in the morning -- sleep till noon.
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] zope and LDAP for authorisation

2005-12-19 Thread Jens Vagelpohl


On 19 Dec 2005, at 13:59, Marinussen, M.J. (Ria) wrote:


Hi Jens,




I need the full error traceback to help.



The full traceback on:
Zope 2.7.2-0, python 2.3.5, win32
LDAPUserFolder 2.6
OpenLDAP 2.3.11

When I type the correct LDAP password I get this error and traceback
(otherwise I get an "Unauthorized" error).


Looking at the code this looks like it is a misconfiguration on your  
part. It looks like the attribute you use as the login attribute has  
not been added to the attributes shown on the LDAP Schema tab in the  
ZMI.


jens

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

http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] zope and LDAP for authorisation

2005-12-19 Thread Einar Næss Jensen
On 12/12/05, Marinussen, M.J. (Ria) <[EMAIL PROTECTED]> wrote:
I've checked out LDAPUserFolder but that's not what I'm looking for (Ithink...).Yes it is. It works very well with ldap/ADThe size/len error you get is probably becaouse you have  given wrong settings (wrong id to check against?), but could also be due to the fact that the  AD server will only pass on 1000(?) entries per default.
If you change the settings in your AD to allow for sending the full list of users, you error might go away (as  I recall from my own problems with AD).Stuff to read:
http://support.microsoft.com/?kbid=271088more spesifc:you have to change the setting: MaxPageSize 1000toMaxPageSize [at least as many entries as you have in your AD, pluss some extras in case you get many more new users]
I do not know how much this will stress your webserver (or your AD-servers), but we are running a five year old pentium III with 2GB ram and 4GB Data.fs and and quite a load without seeing any problems.You probably sorted things out now by the time it took me to write this.
Best Regards,Einar Næss Jensen-- Einar Næss Jensenhttp://einar.nidelven-it.no/einarbloghttp://www.homemade.no
tlf: +47 90990249
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


[Zope] ZSQL with different user

2005-12-19 Thread Pier Luigi Fiorini
Hello,
I'm developing a Zope application that uses a PostgreSQL connection and 
several ZSQL objects.
People should log in using a Postgres user and ZSQL object should be executed 
by the user that's logged in. Multiple people can be logged at the same time.
Unfortunately it is not possible because the same Postgres connection is used 
by all the ZSQL object. Is there a way to change the user executing a ZSQL 
query?

An alternative would be to log into the event.log some information (like the 
username, that's stored in the session) and the query source.

Can you point me to some information?

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


Re: [Zope] zope and LDAP for authorisation

2005-12-19 Thread Einar Næss Jensen
Oh

on the tab "LDAP Schema ", you might try to add the chema-item:
sAMAccountName
and use that for your loginID, on the main tab of LDAPUserFolder
--
Einar Næss Jensen
http://einar.nidelven-it.no/einarblog
http://www.homemade.no
tlf: +47 90990249
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists -
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] ZSQL with different user

2005-12-19 Thread Tino Wildenhain

Pier Luigi Fiorini schrieb:

Hello,
I'm developing a Zope application that uses a PostgreSQL connection and 
several ZSQL objects.
People should log in using a Postgres user and ZSQL object should be executed 
by the user that's logged in. Multiple people can be logged at the same time.
Unfortunately it is not possible because the same Postgres connection is used 
by all the ZSQL object. Is there a way to change the user executing a ZSQL 
query?


Well good news and bad news...
Good news first:

yes it can be done

Bad news:

you would have to code it ;)

You could base on the database adapter you currently
have but organize your connection pool on a per
user basis - so you need a connection with
a user-folder as well (Interesting
if you could subclass Userfolder and PsycopgDA...)
so when a user logs in you look in the connection
pool and/or authorize the user and use an idle/new
connection for this user when ZSQL methods are called.

Interesting project but not so easy.

Also in worst case you could end up having

zope-threads X users connection to your database.

And connection setup is somewhat expensive,
so if your pool is too small performance will suffer.

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

http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] ZSQL with different user

2005-12-19 Thread Reinoud van Leeuwen
On Mon, Dec 19, 2005 at 03:39:51PM +0100, Tino Wildenhain wrote:
> Pier Luigi Fiorini schrieb:
> >Hello,
> >I'm developing a Zope application that uses a PostgreSQL connection and 
> >several ZSQL objects.
> >People should log in using a Postgres user and ZSQL object should be 
> >executed by the user that's logged in. Multiple people can be logged at 
> >the same time.
> >Unfortunately it is not possible because the same Postgres connection is 
> >used by all the ZSQL object. Is there a way to change the user executing a 
> >ZSQL query?
> 
> Well good news and bad news...
> Good news first:
> 
> yes it can be done
> 
> Bad news:
> 
> you would have to code it ;)
> 
> You could base on the database adapter you currently
> have but organize your connection pool on a per
> user basis - so you need a connection with
> a user-folder as well (Interesting
> if you could subclass Userfolder and PsycopgDA...)
> so when a user logs in you look in the connection
> pool and/or authorize the user and use an idle/new
> connection for this user when ZSQL methods are called.
> 
> Interesting project but not so easy.
> 
> Also in worst case you could end up having
> 
> zope-threads X users connection to your database.
> 
> And connection setup is somewhat expensive,
> so if your pool is too small performance will suffer.

The postgresql commandline tool psql has a command /user to change the 
details of the current connection. Wouldn't it be easier to use a command 
like that at the beginning of each database request? 

(I think that would still need some hacking in Userfolder and/or 
PsycopgDA, or even in Psyco itself...)


-- 
__
"Nothing is as subjective as reality"
Reinoud van Leeuwen[EMAIL PROTECTED]
http://www.xs4all.nl/~reinoud
__
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] ZSQL with different user

2005-12-19 Thread Andreas Jung



--On 19. Dezember 2005 15:32:46 +0100 Pier Luigi Fiorini 
<[EMAIL PROTECTED]> wrote:



Hello,
I'm developing a Zope application that uses a PostgreSQL connection and
several ZSQL objects.
People should log in using a Postgres user and ZSQL object should be
executed  by the user that's logged in. Multiple people can be logged at
the same time. Unfortunately it is not possible because the same Postgres
connection is used  by all the ZSQL object. Is there a way to change the
user executing a ZSQL  query?



The short version: forget it. DA connections are tied to a particular user.
Connections are persistent and shared across threads and requests. You 
really don't want to connect/re-connect for every request and user. You 
would have to implement your own connection management including connection

pooling *somehow*.

-aj

pgpQhnV4SPuHW.pgp
Description: PGP signature
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] ERROR BeforeTraverse Error while invoking hook

2005-12-19 Thread Chris McDonough
You might have a access rule in there that expects to be able to call  
something that's missing?


On Dec 19, 2005, at 4:29 AM, Maciej Wisniowski wrote:


Hi!

After upgrading our Zope instances from Zope 2.7.2 to 2.8.4 we've  
noticed
new kind of errors in event.log on one of our servers. Error is as  
follows:


2005-12-19T07:53:59 ERROR BeforeTraverse Error while invoking hook:  
"input"

Traceback (most recent call last):
 File "/opt/Zope/2.8.4/lib/python/ZPublisher/BeforeTraverse.py",  
line 144, in __call__

   meth(*(container, request, None)[:args])
AttributeError: __call__

I've looked into BeforeTraverse.py and I see this error is only  
logged to event.log and
is not visible to the users, and it seems to me that it is  
something with acquisition(?)
I need some hints how to find what causes this error - what has  
changed in 2.8.x and

how to deal with this?
Our application is written in ZODB not in products. There is a  
folder named 'input' in it,

may it be the problem?

--
Maciej Wisniowski

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



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

http://mail.zope.org/mailman/listinfo/zope-dev )


[Zope] Re: ZSQL with different user

2005-12-19 Thread Tres Seaver
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Andreas Jung wrote:
> 
> 
> --On 19. Dezember 2005 15:32:46 +0100 Pier Luigi Fiorini
> <[EMAIL PROTECTED]> wrote:
> 
>> Hello,
>> I'm developing a Zope application that uses a PostgreSQL connection and
>> several ZSQL objects.
>> People should log in using a Postgres user and ZSQL object should be
>> executed  by the user that's logged in. Multiple people can be logged at
>> the same time. Unfortunately it is not possible because the same Postgres
>> connection is used  by all the ZSQL object. Is there a way to change the
>> user executing a ZSQL  query?
>>
> 
> The short version: forget it. DA connections are tied to a particular user.
> Connections are persistent and shared across threads and requests. You
> really don't want to connect/re-connect for every request and user. You
> would have to implement your own connection management including connection
> pooling *somehow*.

Heh, one could create a user-specific connection and stash it in the
session. ;)  This would actually be a lot like what some of the more
RDB-centric web frameworks do already.


Tres.
- --
===
Tres Seaver  +1 202-558-7113  [EMAIL PROTECTED]
Palladion Software   "Excellence by Design"http://palladion.com
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.1 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFDptj2+gerLs4ltQ4RAt3NAJ93414VDh+tOibJGXENarPaai1x1gCggOD6
sRvr/l2jNeYXaTExZm2A4Wg=
=zWbW
-END PGP SIGNATURE-

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


[Zope] question for anyone using apache on windows

2005-12-19 Thread michael nt milne
Does RewriteEngine work on Apache for Windows 2.0.5 ?I'm getting the following..Syntax error on line 960 of C:/Program Files/Apache Group/Apache2/conf/httpd.conf:
Invalid command 'RewriteEngine', perhaps mis-spelled or defined by a module not
included in the server configurationNote the errors or messages above, and press the  key to exit.  22...NameVirtualHost ip:80
ServerName nameRewriteEngine OnRewriteRule ^/(.*) 
http://ip:8080/VirtualHostBase/http/name:80/site/VirtualHostRoot/$1 [L,P]

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


Re: [Zope] SQL transaction uncommited?

2005-12-19 Thread Vlada Macek

[At 19.12.2005 01:39, Gabriel Genellina kindly sent the following
quotation.]


Gabriel, I appreciate you also reviewed my code.


>> def manage_afterAdd(self, item, container): if item is self:
>> self.db = getattr(self,MY_CONNECTION_ID)._v_database_connection
>
> Keeping a _v_ attribute is *not* a good idea - it's suposed to be
> *volatile*.

Later I moved the connection obj lookup to qry() method, so the
volatility of the attribute is not an issue now. I also learnt from
Shared/DC/ZRDB/Connection.py what you were talking about and changed
"._v_database_connection" to "()", which definitely looks cleaner. :-)

>> def qry(self, query): results = self.db.query(query) recs = {
>> 'names': Results(results).names(), 'tuples':
>> Results(results).tuples() } return recs
>
> Why create a Results object twice? results =
> Results(self.db.query(query))...

I also fixed this overlook later, thanks.

> I don't know how the ProgressSQL adapter is implemented, but *if*
> every query() call created a different connection or started a
> different transaction -which does not complete until the Zope
> transaction commits finally- *then* you would see those results.
> Updates made by the *same* transaction should always be available to
> that transaction, whatever the trans. isolation level in use. If this
> was the case, that may indicate that the Progress adapter is not
> properly written.

On psycopg mailing list I was informed that my problem is a known issue
of version 2.0b6 and that I should wait for b7 or take SVN head.

People, do not trust everything you are told on IRC. Sometimes it's
better to stay with stable releases, psycopg 1.1.18 works great and as
expected. :-)


-- 

\//\/\
(Sometimes credited as 1494 F8DD 6379 4CD7 E7E3 1FC9 D750 4243 1F05 9424.)

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


Re: [Zope] question for anyone using apache on windows

2005-12-19 Thread Jens Vagelpohl


On 19 Dec 2005, at 16:33, michael nt milne wrote:


Does RewriteEngine work on Apache for Windows 2.0.5 ?

I'm getting the following..

Syntax error on line 960 of C:/Program Files/Apache Group/Apache2/ 
conf/httpd.con

f:
Invalid command 'RewriteEngine', perhaps mis-spelled or defined by  
a module not

included in the server configuration
Note the errors or messages above, and press the  key to  
exit.  22...


Of course it does. I would assume you don't have it (mod_rewrite)  
configured for loading or it's simply not in your installation.


jens

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

http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] question for anyone using apache on windows

2005-12-19 Thread Andreas Jung

Likely the rewrite module isn't loaded (check the corresponding LoadModule
statements of your configuration).

-aj

--On 19. Dezember 2005 16:33:59 + michael nt milne 
<[EMAIL PROTECTED]> wrote:



Does RewriteEngine work on Apache for Windows 2.0.5 ?

I'm getting the following..

Syntax error on line 960 of C:/Program Files/Apache
Group/Apache2/conf/httpd.con
f:
Invalid command 'RewriteEngine', perhaps mis-spelled or defined by a
module not
included in the server configuration
Note the errors or messages above, and press the  key to exit.  22...



NameVirtualHost ip:80

ServerName name
RewriteEngine On
RewriteRule ^/(.*)
http://ip:8080/VirtualHostBase/http/name:80/site/Virt
ualHostRoot/$1 [L,P]







pgpa7v5VYOU9t.pgp
Description: PGP signature
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Re: ZSQL with different user

2005-12-19 Thread Vlada Macek
> Andreas Jung wrote:
>
>> --On 19. Dezember 2005 15:32:46 +0100 Pier Luigi Fiorini
>> <[EMAIL PROTECTED]> wrote:
>
>>> Hello, I'm developing a Zope application that uses a PostgreSQL
>>> connection and several ZSQL objects. People should log in using a
>>> Postgres user and ZSQL object should be executed by the user
>>> that's logged in. Multiple people can be logged at the same time.
>>> Unfortunately it is not possible because the same Postgres
>>> connection is used by all the ZSQL object. Is there a way to
>>> change the user executing a ZSQL query?
>>>
>> The short version: forget it. DA connections are tied to a
>> particular user. Connections are persistent and shared across
>> threads and requests. You really don't want to connect/re-connect
>> for every request and user. You would have to implement your own
>> connection management including connection pooling *somehow*.


I would also be interested in multiuser ZSQLs, though it's not my main
goal and I don't expect participating on such coding.

Provided there wont be thousands of users (mine number is just about
20), how about to create a pool of connections in some ZODB folder,
simply identified as sqlconn_jack, sqlconn_john, sqlconn_martin, ... and
teach ZSQLMethod to select appropriate connection upon request?

SQL connections currently support auto-connection upon request, so a
timeout disconnection would be nice added feature in this case, but for
small number of users it does not seem to be necessary.

I think this would be a considerable, but easily implemented, step to
obtain SQL userbase binding.

Is there a problem somewhere?

-- 
\//\/\

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


Re: [Zope] question for anyone using apache on windows

2005-12-19 Thread michael nt milne
ok, i simply downloaded the Apache 2.0.55 release for Windoes from Apache. Thre RewriteEngine is set to on in the httpd.conf. God knows why the module wouldn't be available in the distribution. Do you know any documentation on how to install on module at all? The unix version comes with it by default I think.

On 12/19/05, Andreas Jung <[EMAIL PROTECTED]> wrote:
Likely the rewrite module isn't loaded (check the corresponding LoadModulestatements of your configuration).-aj--On 19. Dezember 2005 16:33:59 + michael nt milne<
[EMAIL PROTECTED]> wrote:> Does RewriteEngine work on Apache for Windows 2.0.5 ?>> I'm getting the following..>> Syntax error on line 960 of C:/Program Files/Apache
> Group/Apache2/conf/httpd.con> f:> Invalid command 'RewriteEngine', perhaps mis-spelled or defined by a> module not> included in the server configuration> Note the errors or messages above, and press the  key to exit.  22...
 NameVirtualHost ip:80> > ServerName name> RewriteEngine On> RewriteRule ^/(.*)> 
http://ip:8080/VirtualHostBase/http/name:80/site/Virt> ualHostRoot/$1 [L,P]> 
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Re: ZSQL with different user

2005-12-19 Thread Andreas Jung



--On 19. Dezember 2005 17:54:31 +0100 Vlada Macek <[EMAIL PROTECTED]> 
wrote:





Is there a problem somewhere?


The problem is likely that someone needs to write the code :-)

-aj

pgpAXDoke5uDy.pgp
Description: PGP signature
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Re: ZSQL with different user

2005-12-19 Thread Vlada Macek
[At 19.12.2005 18:02, Andreas Jung kindly sent the following quotation.]

>
>
> --On 19. Dezember 2005 17:54:31 +0100 Vlada Macek
> <[EMAIL PROTECTED]> wrote:
>
>> Is there a problem somewhere?
>
> The problem is likely that someone needs to write the code :-)

Indeed, we have already voted for this. :-) I'm too unexperienced in
Zope coding. Just wanted to know whether my idea is sane.

-- 
\//\/\
(Sometimes credited as 1494 F8DD 6379 4CD7 E7E3 1FC9 D750 4243 1F05 9424.)

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


Re: [Zope] Re: ZSQL with different user

2005-12-19 Thread Andreas Jung



--On 19. Dezember 2005 18:06:49 +0100 Vlada Macek <[EMAIL PROTECTED]> 
wrote:


Indeed, we have already voted for this. :-) I'm too unexperienced in
Zope coding. Just wanted to know whether my idea is sane.



Better collect some money to get this feature implemented *wink*

-aj

pgpOtxKhw4S1i.pgp
Description: PGP signature
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] question for anyone using apache on windows

2005-12-19 Thread michael nt milne
HiOk so I looked at this stuff but can't find anything listed for point 3. Also I had to set Plone to listen on 8080 within its config file and now get Apache for my Plone domains. However they won't re-direct to the right site within the Plone installation. I've achieved this on Unix with the virtual host stuff below.
Find the httpd.conf file (usually you will find it in a folder called conf, config or something along those lines)Inside the httpd.conf file uncomment the line LoadModule rewrite_module modules/mod_rewrite.so
 (remove the pound '#' sign from in front of the line)Also find the line ClearModuleList is uncommented then find and make sure that the line AddModule mod_rewrite.c is not commented out.
> NameVirtualHost ip:80> > ServerName name> RewriteEngine On> RewriteRule ^/(.*)> 

http://ip:8080/VirtualHostBase/http/name:80/site/Virt> ualHostRoot/$1 [L,P]> On 12/19/05, michael nt milne
 <[EMAIL PROTECTED]> wrote:
ok, i simply downloaded the Apache 2.0.55 release for Windoes from Apache. Thre RewriteEngine is set to on in the httpd.conf. God knows why the module wouldn't be available in the distribution. Do you know any documentation on how to install on module at all? The unix version comes with it by default I think.


On 12/19/05, Andreas Jung <[EMAIL PROTECTED]
> wrote:
Likely the rewrite module isn't loaded (check the corresponding LoadModulestatements of your configuration).-aj--On 19. Dezember 2005 16:33:59 + michael nt milne<

[EMAIL PROTECTED]> wrote:> Does RewriteEngine work on Apache for Windows 2.0.5 ?>> I'm getting the following..>> Syntax error on line 960 of C:/Program Files/Apache

> Group/Apache2/conf/httpd.con> f:> Invalid command 'RewriteEngine', perhaps mis-spelled or defined by a> module not> included in the server configuration> Note the errors or messages above, and press the  key to exit.  22...
 NameVirtualHost ip:80> > ServerName name> RewriteEngine On> RewriteRule ^/(.*)> 

http://ip:8080/VirtualHostBase/http/name:80/site/Virt> ualHostRoot/$1 [L,P]> 


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


Re: [Zope] ZSQL with different user

2005-12-19 Thread Tino Wildenhain
Am Montag, den 19.12.2005, 15:43 +0100 schrieb Reinoud van Leeuwen:

> The postgresql commandline tool psql has a command /user to change the 
> details of the current connection. Wouldn't it be easier to use a command 
> like that at the beginning of each database request? 

Well this \connect command really reconnecting.
There is SET SESSION AUTHORIZATION but I'm not
sure if it really helps.

Regards
Tino Wildenhain

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


Re: [Zope] ZSQL with different user

2005-12-19 Thread J Cameron Cooper

Pier Luigi Fiorini wrote:

Hello,
I'm developing a Zope application that uses a PostgreSQL connection and 
several ZSQL objects.
People should log in using a Postgres user and ZSQL object should be executed 
by the user that's logged in. Multiple people can be logged at the same time.
Unfortunately it is not possible because the same Postgres connection is used 
by all the ZSQL object. Is there a way to change the user executing a ZSQL 
query?


An alternative would be to log into the event.log some information (like the 
username, that's stored in the session) and the query source.


Your alternative is dead easy. zLOG (or, better, the Python logging 
module, for which zLOG is now a facade) is quite easy to use. You can 
even make your own log file to contain only such events.


--jcc
--
"Building Websites with Plone"
http://plonebook.packtpub.com
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Can't pickle objects in acquisition wrappers

2005-12-19 Thread Keith Alperin
This is almost definitely my problem as my products keep direct  
references to other persistent objects all of the time.


Out of curiosity, has this always been a poor practice or is it  
something that changed recently?


Many thanks Gabriel (and others).

Keith

On Dec 18, 2005, at 11:00 PM, Gabriel Genellina wrote:


At Monday 19/12/2005 00:53, Keith Alperin wrote:


I'm returning to Zope after about a year away and am working on a
project that i have pieced together over about 4 years.  I recently
deployed this project (a family history web site) under a zope 2.7.x
install (it used to run on a 2.4.x install) and now I can't seem to
update any of my objects.  when i try to save them, I get a
TypeError: Can't pickle objects in acquisition wrappers.  I was never


You should not store a persistent attribute that is an acquisition  
wrapper itself. (What is that... see the corresponing chapter in  
the Zope Developers Guide).
You are developing your own Product, I presume? Perhaps, you are  
keeping a direct reference to another persistent object? You should  
store its id instead, o use a container like ObjectManager.

Without more information that's all I can guess...


Gabriel Genellina
Softlab SRL


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

http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Can't pickle objects in acquisition wrappers

2005-12-19 Thread Jens Vagelpohl


On 19 Dec 2005, at 18:07, Keith Alperin wrote:

This is almost definitely my problem as my products keep direct  
references to other persistent objects all of the time.


Out of curiosity, has this always been a poor practice or is it  
something that changed recently?


It's always been poor practice.

jens

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

http://mail.zope.org/mailman/listinfo/zope-dev )


[Zope] Zope, Apache, REMOTE_USER

2005-12-19 Thread Robert Boyd
I'm using Apache 2.0, and I cannot find a solution to passing the
value of REMOTE_USER from Apache to Zope when using a rewrite rule. I
have Apache rewriting requests for Zope, and hooked into Tomcat with
mod_jk. My users login through a servlet, and Apache has REMOTE_USER
available to it. But any subsequent request to Zope loses this value.
I used to have this all working when using FastCGI, but I'm hoping to
use only mod_rewrite. Is it possible?

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


Re: [Zope] Can't pickle objects in acquisition wrappers

2005-12-19 Thread Gabriel Genellina

At Monday 19/12/2005 15:07, Keith Alperin wrote:


This is almost definitely my problem as my products keep direct
references to other persistent objects all of the time.

Out of curiosity, has this always been a poor practice or is it
something that changed recently?


Not sure when started to be checked, but has never been a good practice, at 
least because the memory leak it produces (circular references).



Gabriel Genellina
Softlab SRL 


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

http://mail.zope.org/mailman/listinfo/zope-dev )


[Zope] Re: [Zope-dev] Re: sessions in the presence of conflicts

2005-12-19 Thread Dennis Allison

Chris McDonough identified a persistence problem with the routine(s) that 
manage sessions variables.  (Thanks Chris)  I have put the correction in 
place which resolved some (but not all) of the problems.

There are still problems which are apparently due conflicts in accessing
the session variables.  To minimize frequency of conflicts, I am rewriting
several routines using Dieter's rules of the thumb (Thanks Dieter).

One routine being modified is a Script(Python) that initializes a number
of session variables.  I am collecting the session values in a dictionary
and then use update to set their value, for example:

s = {}
s['alpha'] = 'a'
s['beta'] = 'b'
request['SESSION'].update(s)

Is the persistence machinery smart enough to detect this as a change?  I
suspect that it has to be flagged since the assignment won't be seen.  
Usually this means setting the _p_changed=1 attribute, but it is not clear
to me where to set it in this particular context.  






-- 

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


Re: [Zope] Re: [Zope-dev] Re: sessions in the presence of conflicts

2005-12-19 Thread David H

Dennis Allison wrote:

Chris McDonough identified a persistence problem with the routine(s) that 
manage sessions variables.  (Thanks Chris)  I have put the correction in 
place which resolved some (but not all) of the problems.


There are still problems which are apparently due conflicts in accessing
the session variables.  To minimize frequency of conflicts, I am rewriting
several routines using Dieter's rules of the thumb (Thanks Dieter).

One routine being modified is a Script(Python) that initializes a number
of session variables.  I am collecting the session values in a dictionary
and then use update to set their value, for example:

s = {}
s['alpha'] = 'a'
s['beta'] = 'b'
request['SESSION'].update(s)

Is the persistence machinery smart enough to detect this as a change?  I
suspect that it has to be flagged since the assignment won't be seen.  
Usually this means setting the _p_changed=1 attribute, but it is not clear
to me where to set it in this particular context.  







 


Dennis,

Did you means request['SESSION']['someDictionary'].update(s)?
Anyway your idea seems correct - The SESSIONS chapter (at least on 
plope.com) addresses SESSION "staleness" and mutable objects.


1) someDict = SESSION['someDict']
2) someDict['someKey'] = "newValue"

But (2) does not guarentee that a subsequent lookups like:
SESSION['someDict'] will return "newValue".

But this WILL:
3) SESSION['someDict'] = someDict.

Which looks like your example.  How this connect to your primary issue:  
*conflicts* is not clear to me.  :-\


David


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

http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Re: [Zope-dev] Re: sessions in the presence of conflicts

2005-12-19 Thread Dennis Allison

The interaction between sessions, conflicts, and persistence is a bit
confusing.  I am still trying to understand the code in depth.  

One thing is for sure, request.SESSION and/or request['SESSION'] must be
persistent for things to work.  Mutable objects in the session variable
set (dictionaries and lists) have to be handled specially to get the
persistence machinery to recognize they have been changed.

In this case, I am trying to ensure that the session variables get 
identified as persistent.  My question is whether using update (an 
implicit assignment) triggers the persistence mechanism.  It is the 
moral equivalent of writing 

request['SESSION']['alpha'] = 'a'B
request['SESSION']['beta'] = 'b'

but I am unsure whether the persistence mechanism will recognize it as 
such.  

Doing session variable initialization in a Script(Python) object has a
downside because one cannot set a _p_changed attribute and so must rely on
the assignment paradigm.  Perhaps the interface should be in a Product or
External Method which is less constrained.

Anyhow, David, thanks for the assist.


On Mon, 19 Dec 2005, David H wrote:

> Dennis Allison wrote:
> 
> >Chris McDonough identified a persistence problem with the routine(s) that 
> >manage sessions variables.  (Thanks Chris)  I have put the correction in 
> >place which resolved some (but not all) of the problems.
> >
> >There are still problems which are apparently due conflicts in accessing
> >the session variables.  To minimize frequency of conflicts, I am rewriting
> >several routines using Dieter's rules of the thumb (Thanks Dieter).
> >
> >One routine being modified is a Script(Python) that initializes a number
> >of session variables.  I am collecting the session values in a dictionary
> >and then use update to set their value, for example:
> >
> > s = {}
> > s['alpha'] = 'a'
> > s['beta'] = 'b'
> > request['SESSION'].update(s)
> >
> >Is the persistence machinery smart enough to detect this as a change?  I
> >suspect that it has to be flagged since the assignment won't be seen.  
> >Usually this means setting the _p_changed=1 attribute, but it is not clear
> >to me where to set it in this particular context.  
> >

> Dennis,
> 
> Did you means request['SESSION']['someDictionary'].update(s)?
> Anyway your idea seems correct - The SESSIONS chapter (at least on 
> plope.com) addresses SESSION "staleness" and mutable objects.
> 
> 1) someDict = SESSION['someDict']
> 2) someDict['someKey'] = "newValue"
> 
> But (2) does not guarentee that a subsequent lookups like:
> SESSION['someDict'] will return "newValue".
> 
> But this WILL:
> 3) SESSION['someDict'] = someDict.
> 
> Which looks like your example.  How this connect to your primary issue:  
> *conflicts* is not clear to me.  :-\
> 
> David
> 
> 

-- 

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


Re: [Zope] Re: [Zope-dev] Re: sessions in the presence of conflicts

2005-12-19 Thread David H




Dennis Allison wrote:

  The interaction between sessions, conflicts, and persistence is a bit
confusing.  I am still trying to understand the code in depth.  

One thing is for sure, request.SESSION and/or request['SESSION'] must be
persistent for things to work.  Mutable objects in the session variable
set (dictionaries and lists) have to be handled specially to get the
persistence machinery to recognize they have been changed.

In this case, I am trying to ensure that the session variables get 
identified as persistent.  My question is whether using update (an 
implicit assignment) triggers the persistence mechanism.  It is the 
moral equivalent of writing 

	request['SESSION']['alpha'] = 'a'B
	request['SESSION']['beta'] = 'b'

but I am unsure whether the persistence mechanism will recognize it as 
such.  

Doing session variable initialization in a Script(Python) object has a
downside because one cannot set a _p_changed attribute and so must rely on
the assignment paradigm.  Perhaps the interface should be in a Product or
External Method which is less constrained.

Anyhow, David, thanks for the assist.


On Mon, 19 Dec 2005, David H wrote:

  
  
Dennis Allison wrote:



  Chris McDonough identified a persistence problem with the routine(s) that 
manage sessions variables.  (Thanks Chris)  I have put the correction in 
place which resolved some (but not all) of the problems.

There are still problems which are apparently due conflicts in accessing
the session variables.  To minimize frequency of conflicts, I am rewriting
several routines using Dieter's rules of the thumb (Thanks Dieter).

One routine being modified is a Script(Python) that initializes a number
of session variables.  I am collecting the session values in a dictionary
and then use update to set their value, for example:

	s = {}
	s['alpha'] = 'a'
	s['beta'] = 'b'
	request['SESSION'].update(s)

Is the persistence machinery smart enough to detect this as a change?  I
suspect that it has to be flagged since the assignment won't be seen.  
Usually this means setting the _p_changed=1 attribute, but it is not clear
to me where to set it in this particular context.  

  

  
  
  
  
Dennis,

Did you means request['SESSION']['someDictionary'].update(s)?
Anyway your idea seems correct - The SESSIONS chapter (at least on 
plope.com) addresses SESSION "staleness" and mutable objects.

1) someDict = SESSION['someDict']
2) someDict['someKey'] = "newValue"

But (2) does not guarentee that a subsequent lookups like:
SESSION['someDict'] will return "newValue".

But this WILL:
3) SESSION['someDict'] = someDict.

Which looks like your example.  How this connect to your primary issue:  
*conflicts* is not clear to me.  :-\

David



  
  
  

Dennis,
Lets just put the question out there:  Does:

SESSION['someKey'] = someValue

Force a commited transaction?

As opposed to ...
someDict = Session['SomeKey']
someDict['aKey'] = 'aNewValue'

David


David




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