[Zope] ZCatalog: searching where on index == another index

2005-10-21 Thread Etienne Labuschagne
Hi all,

Is there a way to search for all the records where one indexed field
equals another indexed field?

Equivalent SQL query would be:

SELECT * FROM table WHERE field1 = field2

I know I can get all the unique values for field1 and then do a search
for records where field2 = [unique field1 values], but isn't there a
better way?

Etienne

___
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] Versioned connectors from ZODB

2005-07-12 Thread Etienne Labuschagne
Tim,

  . . . Versions solves this for
  me.
 
 Maybe like death would solve my problem with overdue taxes wink.

I did get the versioned connections to work (so far), BUT, I will
definately take your word on it and seek another solution :)

 snip  Like, e.g., in the ZODB 3.2 line,
 
 otherdb = ZODB.DB(storage, cache_size=100, pool_size=2)
 
 Then connections obtained via otherdb.open() will hang if two threads
 already have connections from `otherdb` (that's the effect of
 `pool_size`), and will have ZODB memory caches that strive to keep no
 more than 100 objects in memory across transaction boundaries (the
 effect of `cache_size`).
 snip

to double check:

otherdb = ZODB.DB(existingdb._storage, cache_size=100, pool_size=2)

is ok?  It seems that you can create more than one DB instance that
shares one storage object.

I hit upon the idea of creating another DB instance and sharing the
storage object myself yesterday, but wasn't sure what the
repurcussions will be.  Your post answers most of my questions.

 I have one left, though:  if I do decide to share the storage object
(and not go ZEO for whatever reason), will the caches between the two
DB objects not get out of sync?  In other words, will one DB object
know to invalidate objects in it's caches should that object be
changed through another DB instance?  I know ZEO does this for you,
but I'd like to know what the case would be for two DBs in one
process.

My other option is to create the connections by hand (that way I can
control the cache size easily) and keep my own little pool of
connections with a modified close method that does not put my
connections back into the normal pool.  But I'm afraid I may end up
with a new can of worms that way.

 This answer assumes you're using ZODB directly.  I don't know details
 of how to spell it from within a Zope application (if that's what you
 need -- unsure).

I use the ZODB directly, but from within Zope.  The connections are
used in long-running processes that are not nescesarily
browser-triggered.  Some of them are scheduled events that are started
up in their own thread.  From there the need to get new connections to
the ZODB.  I have quite a bit of experience working safely with
multiple threads and the ZODB, so I'm sure I have that part right.  My
problem had more to do with cache contamination and reserving
special connections for specific processes.

Thanks for the reply
Etienne
___
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] Versioned connectors from ZODB

2005-07-11 Thread Etienne Labuschagne
If I get a versioned connection from the ZODB:

conn = Zope.DB.open(version=myVersion)
root = conn.root()
app = root['Application']

# do some stuff

get_transaction().commit()
conn.close()

Are the changes now in a version?  How do I get those changes rolled
into the trunk version of the ZODB?  I guess all objects changed in
the version will now be locked to that version until I apply the
version changes to the trunk?

Thanks
Etienne
___
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] Versioned connectors from ZODB

2005-07-11 Thread Etienne Labuschagne
On 7/11/05, Florent Guillaume [EMAIL PROTECTED] wrote:
 ZODB versions are deprecated, unsupported, buggy and hard to use. Don't
 use them.
 
 Florent

And as I understand, so are temporary connections too.  That leaves me
with getting a normal ZODB connection from the pool which I don't
want to do.

I really need a temporary connection that I can discard.  This
connection can have a much smaller cache than the normal connections
as it makes very little difference in the speed of data loading. 
Second prize is a connection that will only be used by a specific
process and never used for other processes.  Versions solves this for
me.

I can check out a connection and keep it aside only for data loading. 
But this means that I waste precious memory on a connection that does
not really need to cache the amount of objects that the other
connections should.  In my case, this translates to using 1GB of RAM
on one connection that gets used once a day.

Please believe me that I really need a special connection.  For
those who really want to know why, below is an attempt at an
explanation why:

In the application that I have written, I want to be able to get
connections that are not part of the normal connection pool.  Once my
process is finished, I can store these connections for later use, or
discard them.  Currently my application uses the normal connections in
the pool.  The problem is that this process contaminates the cache
of the connections with objects that are not used in normal client
application use (I use a thick client).  This means that the client
applications are extremely slow the next day and that it takes a long
time before the cache contains the often used objects again.

From there the reason why I DON'T want to use the connections for my
once a day data loading process.

My ZODB contains about 700`000 objects.  A connection caches about
60`000 objects to give satisfactory client speed.  To start up the
client before the cache is initialized, takes about 5 minutes.  Once
the cache is populated, it takes a client seconds to start up.  Data
loading invalidates all of this, but is worse than a clean cache in
that it takes long for the new objects in the cache to be flushed
and replaced by the often used objects again.  Data loading does not
need such a big cache since it mostly loads data into the ZODB. 
Unfortunately, the loaded objects also end up in the cache.

Why do I need so many objects in the cache?  Some searches cannot be
done with a mere ZCatalog search and have to run through a subset of
all the objects.  These tend to fit nicely in the cache.
___
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] Problems with temporary connections

2005-07-08 Thread Etienne Labuschagne
I need to make a temporary connection to the ZODB.  I have really good
reasons relating to performance and not wanting have objects in the
current cache getting removed from the cache on why I don't want to
make use of the connections in the pool.  I can elaborate on this if
really nescessary...

The supposed way to get a temporary connection would be:

conn = Globals.DB.open(temporary=1)

which works fine.  The problem is that one cannot:
conn.close()

as this puts the connector back into the pool, where it shouldn't go
and if you do it, causes all kinds of nasty lockups, etc.

I have read some old posts that advise against using temporary
connectors as this can lead to memory leaks (as I can attest to after
trying to use them) and that temporary connections seem to be
broken.

How can I get a connector, that will not be used by other normal
processes, that I can release cleanly when I am finished with it?  Or
at least ensure that one of the connectors in the pool is reserved for
a specific process and that that connector will only be used by that
process.  Can I do this by giving a version to the connector?

Any suggestions?

Etienne
___
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] Best way to upgrade an existing Zope installation?

2001-01-29 Thread Etienne Labuschagne

Hi there

Maybe this has been answered a million times, but I can't find it.  What is
(generally) the best way to upgrade an existing Zope installation?
(Including products, etc.)

Must I export/import everthing, can I just copy the data.fs file or install
the new Zope right over the old one (and then recopying the data file)?

Thanks
Etienne

Tel: (012) 348 4586
Cel: 082 442 8981
Fax: (012) 361 8355


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




RE: [Zope] let problem (or just a stupid newbie)

2001-01-29 Thread Etienne Labuschagne

Hi there

You must close the dtml-let tag like below (exactly what the error said ;)

  dtml-var standard_html_header
  dtml-let person="'Bob'"
   dtml-var person
--  /dtml-let
   dtml-var standard_html_footer

-Original Message-
From: Hans de Wit [mailto:[EMAIL PROTECTED]]
Sent: Monday, January 29, 2001 12:58 PM
To: [EMAIL PROTECTED]
Subject: [Zope] let problem (or just a stupid newbie)

snip

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




[Zope] Dowloading images from another site with external method?

2001-01-24 Thread Etienne Labuschagne

Hi all

I have an external Python method in Zope that accesses a map server through
an ActiveX connector.  This map server creates a map and gives me the URL
where I can download the map eg.
"http:\\www.mysite.com\images:8081\img1234545.png"

I want to download this image with the method, put it in a folder on my Zope
server's disk, do some image processing with PIL and then upload it into my
Zope site.

My problem is that I don't know how to download the image from the URL
above!  I can have zope display it from that address, but that won't work as
the map server eventually deletes the rendered maps (also I want to edit it
first) I cannot use ftplib as the map server does not handle ftp requests,
only http.  I don't know how to use the httplib (or whatever) to download
that image to my disk.

Any help?  

Thanks
Etienne

Tel: (012) 348 4586
Cel: 082 442 8981
Fax: (012) 361 8355


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




[Zope] Zope vs. Apple's WebObjects

2001-01-19 Thread Etienne Labuschagne

Hi all

A friend of mine knows Apple's WebOjects and Enterprise Object framework
quite well and is quite impressed with it.  He wants to know if there is a
"nutshell" comparison between this product and Zope and how they compare
(apart obviously from the eh, slight price difference!).

Any pointers or comments will be greatly appreciated!
Etienne

Tel: (012) 348 4586
Cel: 082 442 8981
Fax: (012) 361 8355


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




[Zope] How to backup Zope data base?

2001-01-18 Thread Etienne Labuschagne

Hi all

What is the best way to backup Zope's database whithout stopping Zope?  When
I use backup, it just says that the file is in use and cannot be backed up.
What I have done so far is to copy the file in explorer and back that up -
but it feels kludgey and I'm not sure if I get the database in a state that
is safe.

Thanks all
Etienne

Tel: (012) 348 4586
Cel: 082 442 8981
Fax: (012) 361 8355


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




[Zope] Calling other frames

2001-01-14 Thread Etienne Labuschagne

Hi there

I have a navigation/sitemap object that shows the user where he is in the
website at the current moment.  I want this object eg. to sit in the left
frame.  This object must update every time the main (right) frame updates to
reflect the position of the right frame.  The website can be navigated both
from this navigation/sitemap object or from links inside the website itself.
Thus, the object must also update itself even if it is not used as the means
to navigate the site.

How do I "talk" to objects in other frames? Or is there a better way to do
this? 

I know that this can probably be done with Javascript, but would prefer to
use Zope as far as I can.

Thanks!
Etienne

Tel: (012) 348 4586
Cel: 082 442 8981
Fax: (012) 361 8355


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




[Zope] Multiple servers on Zope?

2001-01-09 Thread Etienne Labuschagne

Hi there

How can I create "multiple" web servers on Zope as in IIS?  We have a few
domains that resolve to the same IP address. When a user accesses eg.
www.geospace.co.za they must get to a different site than when they access
www.triangletyre.co.za even though both addresses resolve to the same IP
address.  In IIS you just create a new virtual web site that "responds" to
the new domain name.  I am not using Zope through IIS and would actually
like to get rid of IIS altogether.

Any help to a Zope newbie would be GREATLY appreciated!
Etienne

Tel: (012) 348 4586
Cel: 082 442 8981
Fax: (012) 361 8355


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