[Zope-dev] Simple Question

2001-05-23 Thread jawad haider
Hi:
I have recently started exploring zope and I want to develop this simple thing:
A search form and when somebody presses the submit button after specifying  the search criteria, I want 
search results to be displayed on the same page below the  the search criteria.
 
Following is the piece of code,
 
NameAge
 

Here dtFindCustomer is a DTML method which in turns call z sql method which performs actual search in the MY SQL DB. Any suggetions, links or references to acomplish this are welcome.
 
Regards
Jawad
 
 Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.

___
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] CoreSessionTracking 0.8

2001-05-23 Thread Howard Zhang

Hi 
The problem about CoreSessionTracking we describe before we can
repeat again now. 
The step is:
   ( 1 )  User adds Burger to shopping cart
   ( 2 )  User adds coke to shopping cart and click link to add coke
again before request finished  
   ( 3 )  The Burger is disappear in shopping cart and just one coke
( not two )
   ( 4 )  Repeat the step 2,Burger is back

Anything you could tell me would be helpful.
 
Regards,
 
howard


___
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] CoreSessionTracking 0.8

2001-05-23 Thread Chris McDonough

I remember this problem, but I haven't been able to reproduce it.  But
maybe it's because I'm not understanding the steps to reproduce it.  The
sentence "user adds coke to shopping cart and click link to add coke
again before request finished" is hard to understand.  Can you explain? 
Are you using frames?

Howard Zhang wrote:
> 
> Hi
> The problem about CoreSessionTracking we describe before we can
> repeat again now.
> The step is:
>( 1 )  User adds Burger to shopping cart
>( 2 )  User adds coke to shopping cart and click link to add coke
> again before request finished
>( 3 )  The Burger is disappear in shopping cart and just one coke
> ( not two )
>( 4 )  Repeat the step 2,Burger is back
> 
> Anything you could tell me would be helpful.
> 
> Regards,
> 
> howard
> 
> ___
> 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 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 )



Randomness (RE: [Zope-dev] CoreSessionTracking 0.8)

2001-05-23 Thread Bjorn Stabell

Allright, let me try again.  I wish I had a small piece of code to give
you so you can reproduce it, but right now you'd have to get our entire
CMF-based website.

The bug basically manifests itself in that there are two versions of the
variable we put in the session (a shopping cart dict).  When I browse
through the site (not even updating the shopping cart) it'll show one
version for some links (1-40) before it switches to show the other, and
so on.  It looks like the website has two shopping carts that it
switches back and forth between.  You can see the shopping cart on every
page in the website (it's embedded into the template).

We were using frames, but I tried it several times without frames now
and the bug remains.  I even noticed that other variables disappeared
randomly as well, e.g., USER_PREF_LANGUAGES which is set by the
Localizer, resulting in a key error (I've probably seen 300 pages views,
and then suddenly one going back to another page gives a key error?).

I'm very curious what could possibly be causing such problems.  I
thought there might be something wrong in the shared memory between
threads, as I can't see anything else changing but the threads (is there
a way to display which thread is doing the publishing?).

I've seen similar randomness displayed in other situations where I've
been reloading pages that would sometimes (same interval, about every
1-40 times) show one character set, and other times another.  I think
nobody likes to see that kind of randomness.  It gives me a very bad
stomach feeling.  I definately think it's something deeper than a
CoreSessionTracking problem.

Bye,
-- 
Bjorn Stabell <[EMAIL PROTECTED]>

-Original Message-
From: Chris McDonough [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, May 23, 2001 20:34
To: Howard Zhang
Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED]; Exoweb
Subject: Re: [Zope-dev] CoreSessionTracking 0.8


I remember this problem, but I haven't been able to reproduce it.  But
maybe it's because I'm not understanding the steps to reproduce it.  The
sentence "user adds coke to shopping cart and click link to add coke
again before request finished" is hard to understand.  Can you explain? 
Are you using frames?

Howard Zhang wrote:
> 
> Hi
> The problem about CoreSessionTracking we describe before we can
> repeat again now.
> The step is:
>( 1 )  User adds Burger to shopping cart
>( 2 )  User adds coke to shopping cart and click link to add
coke
> again before request finished
>( 3 )  The Burger is disappear in shopping cart and just one
coke
> ( not two )
>( 4 )  Repeat the step 2,Burger is back
> 
> Anything you could tell me would be helpful.
> 
> Regards,
> 
> howard
> 
> ___
> 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 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] getPersistentItemIDs not cooperating?

2001-05-23 Thread Steve Spicklemire


Has anyone seen anything like this?

I have the following script in a Specialist:

## Script (Python) "deleteAllTracks"
##bind container=container
##bind context=context
##bind namespace=
##bind script=script
##bind subpath=traverse_subpath
##parameters=
##title=
##
trackMaster=context.Tracks

import string

iList=[]

for id in trackMaster.defaultRack.getPersistentItemIDs():
iList.append(id)
theItem=trackMaster.getItem(id)
iList.append(theItem.manage_delete())

return "OK! deleted:" + string.join(iList,',')

It works.. partially. For some reason it looks like getPersistentItemIDs 
does not always return a *complete* list. I need to run this method 
several times to completely exhaust the Rack's storage. Thoughts? The 
only way I ever create Track objects is via a different method that is 
only accessed once (a long time ago!)

thanks,
-steve

___
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] Extended DTML Sorting gone into trunk

2001-05-23 Thread Andreas Jung

For your information:

the implementation of the Extended DTML Sorting proposal
(http://dev.zope.org/Wikis/DevSite/Proposals/ExtendedDTMLSorting)
has gone into the trunk. The implementation introduces a
new module "sequence" to the _ namespace. For further
documentation check the online help (search for sequence)
or the implementation under lib/python/DocumentTemplates/sequence.
Thanks to Oleg for the implementation.

Cheers,
Andreas



___
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] getPersistentItemIDs not cooperating?

2001-05-23 Thread Christian Scholz

Hi!

> It works.. partially. For some reason it looks like getPersistentItemIDs 
> does not always return a *complete* list. I need to run this method 
> several times to completely exhaust the Rack's storage. Thoughts? The 
> only way I ever create Track objects is via a different method that is 
> only accessed once (a long time ago!)

Well, I experiences something similar when changing a Racks storage
from persistent to non-persistent. The included objects are marked
as orphaned then and should be deleted with the Clear-Button. This
also works, but only the half of them gets deleted every time I click
on that button.. So I also have to press it several times.. Sounds like
the same problem.. 

cheers,
  Christian

-- 
COM.lounge  http://comlounge.net/
communication & design [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] ZCatalog Brains

2001-05-23 Thread Chris Withers

Hi,

Is it still fair game to use the data_record_normalized_score_ attibute of
ZCatalog Brain objects?

If so, is it accurate and meaningful?

Finally, is there any way I can do the Google-esque thing of showing the snippet
of the searched etxt with the words that were found highlighted?

cheers,

Chris

___
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: Randomness (RE: [Zope-dev] CoreSessionTracking 0.8)

2001-05-23 Thread Albert Langer

It's obvious. This is just Zope's way of telling you not live on hamburgers
and coke.

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of
Bjorn Stabell
Sent: Thursday, May 24, 2001 12:33 AM
To: Chris McDonough; Howard Zhang
Cc: [EMAIL PROTECTED]
Subject: Randomness (RE: [Zope-dev] CoreSessionTracking 0.8)


Allright, let me try again.  I wish I had a small piece of code to give
you so you can reproduce it, but right now you'd have to get our entire
CMF-based website.

The bug basically manifests itself in that there are two versions of the
variable we put in the session (a shopping cart dict).  When I browse
through the site (not even updating the shopping cart) it'll show one
version for some links (1-40) before it switches to show the other, and
so on.  It looks like the website has two shopping carts that it
switches back and forth between.  You can see the shopping cart on every
page in the website (it's embedded into the template).

We were using frames, but I tried it several times without frames now
and the bug remains.  I even noticed that other variables disappeared
randomly as well, e.g., USER_PREF_LANGUAGES which is set by the
Localizer, resulting in a key error (I've probably seen 300 pages views,
and then suddenly one going back to another page gives a key error?).

I'm very curious what could possibly be causing such problems.  I
thought there might be something wrong in the shared memory between
threads, as I can't see anything else changing but the threads (is there
a way to display which thread is doing the publishing?).

I've seen similar randomness displayed in other situations where I've
been reloading pages that would sometimes (same interval, about every
1-40 times) show one character set, and other times another.  I think
nobody likes to see that kind of randomness.  It gives me a very bad
stomach feeling.  I definately think it's something deeper than a
CoreSessionTracking problem.

Bye,
-- 
Bjorn Stabell <[EMAIL PROTECTED]>

-Original Message-
From: Chris McDonough [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, May 23, 2001 20:34
To: Howard Zhang
Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED]; Exoweb
Subject: Re: [Zope-dev] CoreSessionTracking 0.8


I remember this problem, but I haven't been able to reproduce it.  But
maybe it's because I'm not understanding the steps to reproduce it.  The
sentence "user adds coke to shopping cart and click link to add coke
again before request finished" is hard to understand.  Can you explain? 
Are you using frames?

Howard Zhang wrote:
> 
> Hi
> The problem about CoreSessionTracking we describe before we can
> repeat again now.
> The step is:
>( 1 )  User adds Burger to shopping cart
>( 2 )  User adds coke to shopping cart and click link to add
coke
> again before request finished
>( 3 )  The Burger is disappear in shopping cart and just one
coke
> ( not two )
>( 4 )  Repeat the step 2,Burger is back
> 
> Anything you could tell me would be helpful.
> 
> Regards,
> 
> howard
> 
> ___
> 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 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 )

 winmail.dat


Re: [Zope-dev] getPersistentItemIDs not cooperating?

2001-05-23 Thread Steve Alexander

Steve Spicklemire wrote:

> 
> Has anyone seen anything like this?
> 
> It works.. partially. For some reason it looks like getPersistentItemIDs 
> does not always return a *complete* list. I need to run this method 
> several times to completely exhaust the Rack's storage.


Yes, I've seen this. It's on my list of things to look into when I've 
got a certain large project out of the way :-/

> Thoughts? 



Well, getPersistentItemIDs() just returns the result of calling keys() on the Rack's 
BTree.


I guess it is a problem with the BTree code.

I doubt it'll be fixed though. Instead, we should update Rack to use the 
new BTrees module.

--
Steve Alexander
Software Engineer
Cat-Box limited



___
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] getPersistentItemIDs not cooperating?

2001-05-23 Thread Phillip J. Eby

At 05:48 PM 5/23/01 +0200, Christian Scholz wrote:
>Hi!
>
> > It works.. partially. For some reason it looks like getPersistentItemIDs
> > does not always return a *complete* list. I need to run this method
> > several times to completely exhaust the Rack's storage. Thoughts? The
> > only way I ever create Track objects is via a different method that is
> > only accessed once (a long time ago!)
>
>Well, I experiences something similar when changing a Racks storage
>from persistent to non-persistent. The included objects are marked
>as orphaned then and should be deleted with the Clear-Button. This
>also works, but only the half of them gets deleted every time I click
>on that button.. So I also have to press it several times.. Sounds like
>the same problem..

I just thought of how this happens...  if you delete an object from the 
Rack, it's being removed from the virtual list of keys your loop is 
traversing.  So as you iterate from 0..n, and you delete  items from the 
rack, they are removed from the keys list too, the list shortens, and every 
other item in the list is skipped!  This is why you get half the list every 
time.

The fix would probably be:

foo = getPersisentItemIDs()

while foo:
 foo[0].manage_delete()

I should probably do this in ZPatterns too.  I'm working on upgrading it 
for 2.3.2 right now anyway.


___
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] getPersistentItemIDs not cooperating?

2001-05-23 Thread Steve Spicklemire

Well.. it turned out to be more subtle.

It goes back to the old problem that getPersistentItemIDs doesn't return 
a real list, but rather a BTreeItems object. When you call manage_delete 
on *one* item, it affects the BTreesItems object you are iterating over!

This works:

## Script (Python) "deleteAllTracks"
##bind container=container
##bind context=context
##bind namespace=
##bind script=script
##bind subpath=traverse_subpath
##parameters=
##title=
##
trackMaster=context.Tracks

import string

iList=[]

for id in trackMaster.defaultRack.getPersistentItemIDs():
iList.append(id)

dList=[]
for id in iList:
theItem=trackMaster.getItem(id)
theItem.manage_delete()
dList.append(id)


return ("OK! deleted %i elements" % len(iList)) + string.join(iList,',')



On Wednesday, May 23, 2001, at 10:59 AM, Steve Alexander wrote:

> Steve Spicklemire wrote:
>
>> Has anyone seen anything like this?
>> 
>> It works.. partially. For some reason it looks like 
>> getPersistentItemIDs does not always return a *complete* list. I need 
>> to run this method several times to completely exhaust the Rack's 
>> storage.
>
>
> Yes, I've seen this. It's on my list of things to look into when I've 
> got a certain large project out of the way :-/
>
>> Thoughts?
>
>
>
> Well, getPersistentItemIDs() just returns the result of calling keys() 
> on the Rack's BTree.
>
>
> I guess it is a problem with the BTree code.
>
> I doubt it'll be fixed though. Instead, we should update Rack to use 
> the new BTrees module.
>
> --
> Steve Alexander
> Software Engineer
> Cat-Box limited
>
>
>
> ___
> 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 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] getPersistentItemIDs not cooperating?

2001-05-23 Thread Steve Alexander

Steve Spicklemire wrote:
> 
> Well.. it turned out to be more subtle.
> 
> It goes back to the old problem that getPersistentItemIDs doesn't return
> a real list, but rather a BTreeItems object. When you call manage_delete
> on *one* item, it affects the BTreesItems object you are iterating over!

Right... another one of those "it returns a mutable internal object"
problems.

In that case, is there a security problem with what getPersistentItemIDs
returns being accessible to TTW scripting?

I'm changing the OS on my development machine, so I can't easily check
this out right now.

--
Steve Alexander
Software Engineer
Cat-Box limited

___
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] getPersistentItemIDs not cooperating?

2001-05-23 Thread Steve Spicklemire

Hi Phil,

Yup.. I realized it when I could *list* all the ids, but not delete 
them. ;-) I'm wondering if it might be better to change the 
implementation of getPersistentItemIDs to return a plain list? This 
would also help avoid permission errors that folks run in to when trying 
to use it in dtml. I realize that listifying takes time, but you 
probably wouldn't call it if you had a very large number of items in the 
rack (you'd maybe query a catalog or something else.. )

-steve

On Wednesday, May 23, 2001, at 11:22 AM, Phillip J. Eby wrote:

> At 05:48 PM 5/23/01 +0200, Christian Scholz wrote:
>> Hi!
>>
>> > It works.. partially. For some reason it looks like 
>> getPersistentItemIDs
>> > does not always return a *complete* list. I need to run this method
>> > several times to completely exhaust the Rack's storage. Thoughts? The
>> > only way I ever create Track objects is via a different method that 
>> is
>> > only accessed once (a long time ago!)
>>
>> Well, I experiences something similar when changing a Racks storage
>> from persistent to non-persistent. The included objects are marked
>> as orphaned then and should be deleted with the Clear-Button. This
>> also works, but only the half of them gets deleted every time I click
>> on that button.. So I also have to press it several times.. Sounds like
>> the same problem..
>
> I just thought of how this happens...  if you delete an object from the 
> Rack, it's being removed from the virtual list of keys your loop is 
> traversing.  So as you iterate from 0..n, and you delete  items from 
> the rack, they are removed from the keys list too, the list shortens, 
> and every other item in the list is skipped!  This is why you get half 
> the list every time.
>
> The fix would probably be:
>
> foo = getPersisentItemIDs()
>
> while foo:
> foo[0].manage_delete()
>
> I should probably do this in ZPatterns too.  I'm working on upgrading 
> it for 2.3.2 right now anyway.

___
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] getPersistentItemIDs not cooperating?

2001-05-23 Thread Steve Spicklemire

Hi Phil,

FYI.. this doesn't work in a PythonScript since indexing into a 
BTreeItems is (apparently) not allowed by the "Security Machinery". 
So... a simple list is looking better and better! ;-)

-steve

On Wednesday, May 23, 2001, at 11:22 AM, Phillip J. Eby wrote:

> The fix would probably be:
>
> foo = getPersisentItemIDs()
>
> while foo:
> foo[0].manage_delete()
>
> I should probably do this in ZPatterns too.  I'm working on upgrading 
> it for 2.3.2 right now anyway.

___
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] ZEO on SMP

2001-05-23 Thread Dyon Balding

Hi,

We are setting up a cluster of ZEO clients on dual processor machines. 
>From some experiments and from searching through the mailing lists, it
appears that a single Zope process will not take full advantage of the
two processors.

The solution would appear to be to run two ZEO clients on each server. 
This, however, is causing problems.

I can successfully run two Zope (non-ZEO) processes on a single machine,
but two ZEO clients don't seem to coexist nicely on the Windows 2000
machine.  The second client to start will accept connections, but never
responds with anything.

Zope: 2.3.2, ZEO: 1.0b3, Windows 2k for clients, Linux and Windows 2k
for storage server.

Is there a better solution?  If not, has anyone come across this
problem?

Any pointers appreciated
-d

___
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] ZEO on SMP

2001-05-23 Thread Tino Wildenhain

Hi Dyon,

ZEO on a dual processor machine runs fine for me.
I'm using redhat-linux for the server (ZEO and Clients
on same machine)
If you dont need strange things I would not recommend
Win2k as server platform.

Best regards
Tino Wildenhain

--On Mittwoch, 23. Mai 2001 11:35 -0700 Dyon Balding <[EMAIL PROTECTED]> 
wrote:

> Hi,
>
> We are setting up a cluster of ZEO clients on dual processor machines.
> From some experiments and from searching through the mailing lists, it
> appears that a single Zope process will not take full advantage of the
> two processors.
>
> The solution would appear to be to run two ZEO clients on each server.
> This, however, is causing problems.
>
> I can successfully run two Zope (non-ZEO) processes on a single machine,
> but two ZEO clients don't seem to coexist nicely on the Windows 2000
> machine.  The second client to start will accept connections, but never
> responds with anything.
>
> Zope: 2.3.2, ZEO: 1.0b3, Windows 2k for clients, Linux and Windows 2k
> for storage server.
>
> Is there a better solution?  If not, has anyone come across this
> problem?
>
> Any pointers appreciated
> -d
>
> ___
> 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 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] Simple Question

2001-05-23 Thread jawad haider

How come no one is answering to my mail below. Is it too trivial or too complex or the people in the list is too busy ? Please respond if you have any clue/suggetion.
 
>From: "jawad haider" <[EMAIL PROTECTED]>
>To: [EMAIL PROTECTED] 
>Subject: [Zope-dev] Simple Question 
>Date: Wed, 23 May 2001 10:35:46 
> 
 
 Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.
Hi:
I have recently started exploring zope and I want to develop this simple thing:
A search form and when somebody presses the submit button after specifying  the search criteria, I want 
search results to be displayed on the same page below the  the search criteria.
 
Following is the piece of code,
 
NameAge
 

Here dtFindCustomer is a DTML method which in turns call z sql method which performs actual search in the MY SQL DB. Any suggetions, links or references to acomplish this are welcome.
 
Regards
Jawad
 
 Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.

___
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] Simple Question

2001-05-23 Thread Andreas Jung

After reading your description I don't know yet what your real
problem or question is ?!

Andreas


From: "jawad haider" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, May 23, 2001 6:51 PM
Subject: Re: [Zope-dev] Simple Question


> How come no one is answering to my mail below. Is it too trivial or too
complex or the people in the list is too busy ? Please respond if you have
any clue/suggetion.
>



___
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] ZEO on SMP

2001-05-23 Thread Dyon Balding

Tino,

Thanks for your reply.

When you say it works fine on a dual processor machine, are you saying
that a single ZEO client fully utilises both processors? or that you
are running two ZEO clients successfully?

Unfortunately I'm currently stuck with Windows due to both political
reasons, and because we are interfacing to a large SQLServer database.

-d

On Wed, May 23, 2001 at 08:44:59PM +0200, Tino Wildenhain wrote:
> Hi Dyon,
> 
> ZEO on a dual processor machine runs fine for me.
> I'm using redhat-linux for the server (ZEO and Clients
> on same machine)
> If you dont need strange things I would not recommend
> Win2k as server platform.
> 
> Best regards
> Tino Wildenhain
> 
> --On Mittwoch, 23. Mai 2001 11:35 -0700 Dyon Balding <[EMAIL PROTECTED]> 
> wrote:
> 
> > Hi,
> >
> > We are setting up a cluster of ZEO clients on dual processor machines.
> > From some experiments and from searching through the mailing lists, it
> > appears that a single Zope process will not take full advantage of the
> > two processors.
> >
> > The solution would appear to be to run two ZEO clients on each server.
> > This, however, is causing problems.
> >
> > I can successfully run two Zope (non-ZEO) processes on a single machine,
> > but two ZEO clients don't seem to coexist nicely on the Windows 2000
> > machine.  The second client to start will accept connections, but never
> > responds with anything.
> >
> > Zope: 2.3.2, ZEO: 1.0b3, Windows 2k for clients, Linux and Windows 2k
> > for storage server.
> >
> > Is there a better solution?  If not, has anyone come across this
> > problem?
> >
> > Any pointers appreciated
> > -d
> >
> > ___
> > 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 )
> 
> 
> 

-- 
Dyon Balding <[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 )



Re: [Zope-dev] ZCatalog Brains

2001-05-23 Thread Michel Pelletier

On Wed, 23 May 2001, Chris Withers wrote:

> Hi,
> 
> Is it still fair game to use the data_record_normalized_score_ attibute of
> ZCatalog Brain objects?

Yes.

> If so, is it accurate and meaningful?

Only for queries involving text indexes, and even then it's not very
meaningful.  It takes the entire batch of search results, from the most
relevant (word occourance score) the the least relevent, and normalizes
all their scores between 0 and 100 (or 0 and 1, same difference).

> Finally, is there any way I can do the Google-esque thing of showing the snippet
> of the searched etxt with the words that were found highlighted?

Yes, You would have to fetch the object and then scan it for the search
terms.

-Michel


___
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] ZEO on SMP

2001-05-23 Thread Randall F. Kern

If I understand your scenario, you are trying to run two instances of
Zope on a single machine, talking to a ZEO server?

That won't work :)

Neither Unix nor Windows knows what to do with two processes trying to
open the same port for listen.  I'm surprised the second Zope instance
even starts.

If you want to try it, start each instance of Zope on different ports,
then use some kind of ipforwarding/load balancer on the box to route
connections to port 80 to either of your Zope servers (say 8081 and
8082).

-Randy

> -Original Message-
> From: Dyon Balding [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, May 23, 2001 12:08 PM
> To: Tino Wildenhain
> Cc: [EMAIL PROTECTED]
> Subject: Re: [Zope-dev] ZEO on SMP
> 
> 
> Tino,
> 
> Thanks for your reply.
> 
> When you say it works fine on a dual processor machine, are you saying
> that a single ZEO client fully utilises both processors? or that you
> are running two ZEO clients successfully?
> 
> Unfortunately I'm currently stuck with Windows due to both political
> reasons, and because we are interfacing to a large SQLServer database.
> 
> -d
> 
> On Wed, May 23, 2001 at 08:44:59PM +0200, Tino Wildenhain wrote:
> > Hi Dyon,
> > 
> > ZEO on a dual processor machine runs fine for me.
> > I'm using redhat-linux for the server (ZEO and Clients
> > on same machine)
> > If you dont need strange things I would not recommend
> > Win2k as server platform.
> > 
> > Best regards
> > Tino Wildenhain
> > 
> > --On Mittwoch, 23. Mai 2001 11:35 -0700 Dyon Balding 
> <[EMAIL PROTECTED]> 
> > wrote:
> > 
> > > Hi,
> > >
> > > We are setting up a cluster of ZEO clients on dual 
> processor machines.
> > > From some experiments and from searching through the 
> mailing lists, it
> > > appears that a single Zope process will not take full 
> advantage of the
> > > two processors.
> > >
> > > The solution would appear to be to run two ZEO clients on 
> each server.
> > > This, however, is causing problems.
> > >
> > > I can successfully run two Zope (non-ZEO) processes on a 
> single machine,
> > > but two ZEO clients don't seem to coexist nicely on the 
> Windows 2000
> > > machine.  The second client to start will accept 
> connections, but never
> > > responds with anything.
> > >
> > > Zope: 2.3.2, ZEO: 1.0b3, Windows 2k for clients, Linux 
> and Windows 2k
> > > for storage server.
> > >
> > > Is there a better solution?  If not, has anyone come across this
> > > problem?
> > >
> > > Any pointers appreciated
> > > -d
> > >
> > > ___
> > > 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 )
> > 
> > 
> > 
> 
> -- 
> Dyon Balding <[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 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] ZEO on SMP

2001-05-23 Thread Dyon Balding

They are listening on different ports, (80 and 81) in my test case.

And yes, there will be a load balancer in front of them (there will
be 15 dual processor servers) to make the cluster appear like one
machine.

-dyon

On Wed, May 23, 2001 at 12:38:25PM -0700, Randall F. Kern wrote:
> If I understand your scenario, you are trying to run two instances of
> Zope on a single machine, talking to a ZEO server?
> 
> That won't work :)
> 
> Neither Unix nor Windows knows what to do with two processes trying to
> open the same port for listen.  I'm surprised the second Zope instance
> even starts.
> 
> If you want to try it, start each instance of Zope on different ports,
> then use some kind of ipforwarding/load balancer on the box to route
> connections to port 80 to either of your Zope servers (say 8081 and
> 8082).
> 
> -Randy

-- 
Dyon Balding <[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 )



Re: [Zope-dev] Simple Question

2001-05-23 Thread jawad haider

Hi:
Thanks for your response. 
I wanted to make a search form in which search criteria and search result will appear on the same page e.g.search criteria on the top and when the submit button is pressed the list of search results should be displayed in the bottom of the page.
But when I try to accomplish this using the following code the search results are displayed on a separate page. 
Following is the piece of code,
 
NameAge
 

Here dtFindCustomer is a DTML method which in turn call z sql method which performs actual search in the MY SQL DB. The control is transfered to the next page when the form action method is called. 
 
HOW CAN i redirect the control on the same page and get the results returned to the same page  and displayed on this same page ?
 
Hope I am able to explain my question this time.
 
Regards
Jawad
 
 

>From: "Andreas Jung" <[EMAIL PROTECTED]>
>To: "jawad haider" <[EMAIL PROTECTED]>, <[EMAIL PROTECTED]>
>Subject: Re: [Zope-dev] Simple Question 
>Date: Wed, 23 May 2001 15:00:44 -0400 
> 
>After reading your description I don't know yet what your real 
>problem or question is ?! 
> 
>Andreas 
> 
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.

___
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] Simple Question

2001-05-23 Thread Andreas Jung


- Original Message -
From: "jawad haider" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Wednesday, May 23, 2001 7:44 PM
Subject: Re: [Zope-dev] Simple Question


> 
> 
> 
>
>
> Here dtFindCustomer is a DTML method which in turn call z sql method which
performs actual search in the MY SQL DB. The control is transfered to the
next page when the form action method is called.
>
> HOW CAN i redirect the control on the same page and get the results
returned to the same page and displayed on this same page ?
>
> Hope I am able to explain my question this time.

Try to add a name attribute to the submit button like:



Inside the DTML method you must check if the 'submitted' variable is set:


  Form has been submitted
.





   




Andreas



___
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] getPersistentItemIDs not cooperating?

2001-05-23 Thread Phillip J. Eby

At 12:33 PM 5/23/01 -0500, Steve Spicklemire wrote:
>Hi Phil,
>
>FYI.. this doesn't work in a PythonScript since indexing into a BTreeItems 
>is (apparently) not allowed by the "Security Machinery". So... a simple 
>list is looking better and better! ;-)

Hmmm.  Good point.  I'll have to think about that one.  I just hate to load 
all those keys if they're not really needed.  I suppose if you call 
getPersistentItemIDs(), you usually want them all...  It's just that if you 
use the BTreeItems object, it can toss out keys that aren't needed.

Maybe what I'll do is implement a wrapper over BTreeItems that fixes this 
somehow.  I'll also have to look at how this works with the new "BTrees" 
trees, because I *know* they don't implement indexing the same way, and may 
not have this problem!


___
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] ZEO on SMP

2001-05-23 Thread Jeremy Hylton

Since a single Python process has a single global interpreter lock,
you'll never fully utilize a 2-processor machine.  The lock is
released whenever a socket call (send, receive, listen, etc.) is made,
so that provides some opportunity for using two CPUs, but not much.

Jeremy


___
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] Simple Question

2001-05-23 Thread Michel Pelletier

On Wed, 23 May 2001, jawad haider wrote:

>
>
> I wanted to make a search form in which search criteria and search
> result will appear on the same page e.g.search criteria on the top and
> when the submit button is pressed the list of search results should be
> displayed in the bottom of the page.
>
> But when I try to accomplish this using the following code the search
> results are displayed on a separate page.

You want to page to 1) draw a form if there are no search criteria and 2)
call itself when the form is submitted.  Andreas already showed how you
can check for a form submission, and havving the page call itself is
simple:



this form will submit to its own URL.  Your question is out of the scope
of this list, which is about Zope core and product development.  This is a
user question, and should be directed to the Zope list [EMAIL PROTECTED]

-Michel



___
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] ZEO on SMP

2001-05-23 Thread David Brown

At 08:26 PM 5/23/2001 -0400, Jeremy Hylton wrote:
>Since a single Python process has a single global interpreter lock,
>you'll never fully utilize a 2-processor machine.


I may be merely demonstrating ignorance, but --

If you, say, launched two separate Zope processes, and one ZEO process, on 
the same machine, aren't you going to be running 3 different Python 
interpreters, each in it's own process?

Couldn't you then be utilizing up to three processors on an SMP box?

I agree that threads within a particular Python interpreter are not really 
going to gain anything because of the global interpreter lock, but isn't 
that a moot point with separate Python interpreter processes?

Or does the TCP/IP stack cause problems?

dave


___
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] ZEO on SMP

2001-05-23 Thread Jeremy Hylton

> "DB" == David Brown <[EMAIL PROTECTED]> writes:

  DB> At 08:26 PM 5/23/2001 -0400, Jeremy Hylton wrote:
  >> Since a single Python process has a single global interpreter
  >> lock, you'll never fully utilize a 2-processor machine.

  DB> If you, say, launched two separate Zope processes, and one ZEO
  DB> process, on the same machine, aren't you going to be running 3
  DB> different Python interpreters, each in it's own process?

  DB> Couldn't you then be utilizing up to three processors on an SMP
  DB> box?

Yes.  I may have misread the original question.  I thought the SMP
machine was running the ZEO server.  If Zope and ZEO clients are both
running on the same machine, I would assume they would run
concurrently on separate processors.

Jeremy


___
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] ZEO on SMP

2001-05-23 Thread Dyon Balding

Well that's what I'm trying to do, but as mentioned in my original
post, any Zope clients utilising ZEO started after the first one do
not respond.  The ZEO storage server is running on a separate machine,
serving the 15 client machines.

-d

On Wed, May 23, 2001 at 05:51:57PM -0700, David Brown wrote:
> At 08:26 PM 5/23/2001 -0400, Jeremy Hylton wrote:
> >Since a single Python process has a single global interpreter lock,
> >you'll never fully utilize a 2-processor machine.
> 
> 
> I may be merely demonstrating ignorance, but --
> 
> If you, say, launched two separate Zope processes, and one ZEO process, on 
> the same machine, aren't you going to be running 3 different Python 
> interpreters, each in it's own process?
> 
> Couldn't you then be utilizing up to three processors on an SMP box?
> 
> I agree that threads within a particular Python interpreter are not really 
> going to gain anything because of the global interpreter lock, but isn't 
> that a moot point with separate Python interpreter processes?
> 
> Or does the TCP/IP stack cause problems?
> 
> dave

-- 
Dyon Balding <[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 )



Re: [Zope-dev] ZEO on SMP

2001-05-23 Thread Bill Anderson

On 24 May 2001 05:07:30 +1000, Dyon Balding wrote:
> Tino,
> 
> Thanks for your reply.
> 
> When you say it works fine on a dual processor machine, are you saying
> that a single ZEO client fully utilises both processors? or that you
> are running two ZEO clients successfully?

I am running dozens of them on a single machine, works damned well.
Pretty snappy too. Of course, this is under Linux, so YMMV.

Each domain/server cluster runs approximately 3 ZCs apiece.

> Unfortunately I'm currently stuck with Windows due to both political
> reasons, and because we are interfacing to a large SQLServer database.

Well, AIUI, the latter is easily solved. :)





___
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] getPersistentItemIDs not cooperating?

2001-05-23 Thread Bill Anderson

On 23 May 2001 12:22:59 -0400, Phillip J. Eby wrote:

> I should probably do this in ZPatterns too.  I'm working on upgrading it 
> for 2.3.2 right now anyway.

A cheer sweeps across the crowd.



___
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] CoreSessionTracking 0.8

2001-05-23 Thread Bill Anderson

On 23 May 2001 19:00:41 +0800, Howard Zhang wrote:
> Hi 
> The problem about CoreSessionTracking we describe before we can
> repeat again now. 
> The step is:
>( 1 )  User adds Burger to shopping cart
>( 2 )  User adds coke to shopping cart and click link to add coke
> again before request finished  
>( 3 )  The Burger is disappear in shopping cart and just one coke
> ( not two )
>( 4 )  Repeat the step 2,Burger is back




Your server is starving, let it get it's fill and feed it regularly.
Quit taking the food away from it. ;)

.



___
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 )