Re: [Zope-dev] Problems with LoginManager form-based login

2000-05-26 Thread Stuart 'Zen' Bishop

On Wed, 24 May 2000, Phillip J. Eby wrote:

 This is a problem that apparently can only be solved by replicating
 ZPublisher's backward walk, which is the wrong thing to do because the
 traversal will be O(n^2).  Bleah.  I guess we'll have to do something like
 Stuart Bishop's backward walk in the GUF, since any enhancement of the
 ZPublisher architecture to handle login forms properly won't happen until
 at least 2.2.

The backward walk stuff (which I don't think ever worked - every time
I fixed one case it seemed I'd break another) has been torn out and
replaced with code that does what you are after. Grab a copy of the
latest version and search for 'WooHoo' in GenericUserFolder.py

 Meanwhile, I suppose Ty and I should try to come up with a proposal for
 revising ZPublisher to be able to walk back on the user lookups but still
 use the login form closest to the URL being accessed.

-- 
Stuart Bishop  Work: [EMAIL PROTECTED]
Senior Systems Alchemist   Play: [EMAIL PROTECTED]
Computer Science, RMIT


___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )




Re: [Zope-dev] DateTime objects's and ZCatalog

2000-05-26 Thread Jason Spisak

Shane Hathaway:

 Jason,
 
 I've looked over your DTML and I can't quite get a fix on what's going
 on (then again, I'm not very familiar with dtml-calendar.)  If you'd
 send more details I might be able to help, but only in my spare time
 I'm afraid...

That's actually a very generous offer.  Thanks.  Basically I am wondering
if calling my extenal method is creating the DataTime instances or the call
to: _.int(date)/10 is?

Here's the external method:

  external method:
  
  def calendar_day(self)
  return int(self.calendar_date)/10
  

The code that really matters I guess is :

   dtml-if "_.len(Catalog(recruiter=AUTHENTICATED_USER.getUserName(),
  meta_types=['Interview', 'Call', 'Appointment', 'Deal'],
  calendar_day=_.int(date)/10))"

BTW, the memory issue is causing me to restart my *server* everyday.  Even
when I shut down the Zope process, the memory doesn't fall out of cache.
I'm going to make this a separate message.

Thanks again,

Jason Spisak
CIO
HireTechs.com
6151 West Century Boulevard
Suite 900
Los Angeles, CA 90045
P. 310.665.3444
F. 310.665.3544

Under US Code Title 47, Sec.227(b)(1)(C), Sec.227(a)(2)(B) This email
address may not be added to any commercial mail list with out my
permission.  Violation of my privacy with advertising or SPAM will
result in a suit for a MINIMUM of $500 damages/incident, $1500 for
repeats.

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )




Re: [Zope-dev] Re: Memory issue 2.1.6 (Hemophelia)

2000-05-26 Thread Matthew T. Kromer

on 5/26/00 1:04 PM, Jason Spisak at [EMAIL PROTECTED] wrote:

 Shane and others:
 
 Currently I have to restart the *server* that Zope runs on everyday in
 order to get the memory tat Zope claims in cache back.  Even when I stop
 the Zope process, the cache doesn't clear.  Is there a command in Linux to
 force that cache to clear?  Also, after a clean reboot, I tried to pack,
 and there is nothing left of my 1 gig of memory, and it swapped a bit. :(
 
 Is there anyway to nail down what is causing the bleeding?  I have reduced
 the number of object stored in cache and even flushed the cache in Zope,
 but it never reclaims all the memory.  What can I do to keep investigating?
 Tools?  Stats that will help?
 
 Hoping to nail this,

I'm extremely curious that the cache doesn't clear when you restart Zope.
One would normally not expect to see this.  Can you do a "ps xauww" and mail
it to me / the list?  Also a "free" would be helpful too.  Under linux,
shared memory is amongst the last to be scavenged in low memory conditions.
I'm curious to see if something is allocating that memory as shared or what.

You might also try an "ipcs -a" command to make sure it's not SYSV type
shared memory (which can stick around even after a process exits.)
-- 
Matthew T. Kromer
[EMAIL PROTECTED]
[EMAIL PROTECTED]


___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )




[Zope-dev] Using FSSession from an external method

2000-05-26 Thread Lindell Alderman

I am trying to use FSSession from an external method.  I have no problem
reading from the Session or updating a dictionary in the Session.  My
problem is that I cannot delete or change any of the entries in the Session
from my external method.  Could this an initialization issue or could
it be a permissions issue?  I can't seem to track it down.

-L


___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )




Re: [Zope-dev] Memory 2.1.4-2.1.6 a.k.a. how to get objects out of the cache

2000-05-26 Thread Bill Anderson

Jason Spisak wrote:

[...]

 That's funny that I am experienceing the same symptoms as you, but my
 installation is totally different. I'm not using GUF, or any DA's, and I'm
 running on RH 6.1.  We really need to figure this out as a community.  I am
 willing to try just about anything short of shipping my machine somewhere
 off premisis. ;)


Ok, let's dig up some more info ( or perhaps I missed it ).

Server setup, as in pcgi/Zserver/Apache w/proxypass, etc?
Compiled on the machine, or binary distribution?

If source, did you start with a clean tree, or did use use the diff
upgrade, or did you use a new 2.1.6 tarball, and drop it on top of the
2.1.4 install?

Bill

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )




Re: [Zope-dev] Problems with LoginManager form-based login

2000-05-26 Thread Evan Simpson

- Original Message -
From: Phillip J. Eby [EMAIL PROTECTED]
 Been there, done that.  Yours doesn't work either, btw.  Well, actually,
it
 does, it's just that it causes a memory leak because it leaves an
 unintended circular reference.  We've got a version that fixes the
circular
 reference, but in a really really ugly way (it does a run-time patch to
 BaseRequest.close() to remove the poked-in unauthorized() method).

The GUF version, at least, doesn't need this drastic a fix.  Adding the
following line to the top of guf_unauthorized should suffice:

del request.RESPONSE.unauthorized

Cheers,

Evan @ digicool  4-am


___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )




Re: [Zope-dev] Problems with LoginManager form-based login

2000-05-26 Thread Phillip J. Eby

At 03:05 PM 5/26/00 -0400, Evan Simpson wrote:
- Original Message -
From: Phillip J. Eby [EMAIL PROTECTED]
 Been there, done that.  Yours doesn't work either, btw.  Well, actually,
it
 does, it's just that it causes a memory leak because it leaves an
 unintended circular reference.  We've got a version that fixes the
circular
 reference, but in a really really ugly way (it does a run-time patch to
 BaseRequest.close() to remove the poked-in unauthorized() method).

The GUF version, at least, doesn't need this drastic a fix.  Adding the
following line to the top of guf_unauthorized should suffice:

del request.RESPONSE.unauthorized


You're making the assumption that unauthorized gets called.  If it doesn't
get called (because the current user *does* exist in a higher-level
folder), then the hook will never get released.


___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )




[Zope-dev] Z SQL: optional isn't?

2000-05-26 Thread Kyler B. Laird


I'd like to build a Z SQL method for *many*
people to use to list courses that we offer.
I don't want to require that all queries
using it understand all of the columns, but
I do want to be able to modify the query in
many ways.

So...after reading
http://yyy.zope.org/Documentation/Guides/ZSQL-HTML/ZSQL.1.5.3.html
optional 

A flag indicating if the test is optional.
If the test is optional and no value is 
provided for a variable, or the value
provided is an invalid empty string, then
no text is inserted.
I thought I could just use "optional"
with all of my sqltests.
select * from course_catalog

dtml-sqlgroup where
dtml-sqltest subject type=nb optional
dtml-and
dtml-sqltest course_nbr type=nb optional
dtml-and
dtml-sqltest version type=nb optional
dtml-and
dtml-sqltest campus_code type=nb optional
/dtml-sqlgroup

This works only if I provide at least an empty
string for all values.  If I don't provide a
value at all for one of the arguments, I get
Error, Bad Request: ['version'] 

SQL used:

Could not render the query template!
Traceback (innermost last):
  File /data/www/Zope/Zope-2.2.0a1-src/lib/python/ZPublisher/Publish.py, line 
224, in publish_module
  File /data/www/Zope/Zope-2.2.0a1-src/lib/python/ZPublisher/Publish.py, line 
189, in publish
  File /data/www/Zope/Zope-2.2.0a1-src/lib/python/Zope/__init__.py, line 221, 
in zpublisher_exception_hook
(Object: list_courses)
  File /data/www/Zope/Zope-2.2.0a1-src/lib/python/ZPublisher/Publish.py, line 
175, in publish
  File /data/www/Zope/Zope-2.2.0a1-src/lib/python/ZPublisher/mapply.py, line 
160, in mapply
(Object: manage_test)
  File /data/www/Zope/Zope-2.2.0a1-src/lib/python/ZPublisher/Publish.py, line 
112, in call_object
(Object: manage_test)
  File /data/www/Zope/Zope-2.2.0a1-src/lib/python/Shared/DC/ZRDB/DA.py, line 
347, in manage_test
(Object: list_courses)
  File /data/www/Zope/Zope-2.2.0a1-src/lib/python/Shared/DC/ZRDB/DA.py, line 
324, in manage_test
(Object: list_courses)
  File /data/www/Zope/Zope-2.2.0a1-src/lib/python/Shared/DC/ZRDB/DA.py, line 
426, in __call__
(Object: list_courses)
  File /data/www/Zope/Zope-2.2.0a1-src/lib/python/Shared/DC/ZRDB/Aqueduct.py, 
line 150, in _argdata
(Object: list_courses)
Bad Request: (see above)

Looking at Aqueduct.py, I don't understand why it's
not catching the "optional" arg.  Using my limited
Python knowledge, I commented out lines 149 and 150
of Aqueduct.py and now it works great.

Once again, I'm glad that I can add these awful
kludges instead of waiting for the vendor, but this
is something that I hope is fixed soon.

--kyler

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )




Re: [Zope-dev] Problems with LoginManager form-based login

2000-05-26 Thread Evan Simpson

- Original Message -
From: Phillip J. Eby [EMAIL PROTECTED]
 The GUF version, at least, doesn't need this drastic a fix.  Adding the
 following line to the top of guf_unauthorized should suffice:
 
 del request.RESPONSE.unauthorized
 

 You're making the assumption that unauthorized gets called.  If it doesn't
 get called (because the current user *does* exist in a higher-level
 folder), then the hook will never get released.

D'oh!  How 'bout if REQUEST.close() were to always do a
self.__dict__.clear()?

Cheers,

Evan @ digicool  4-am


___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )