RE: [Zope-dev] Comments on Zopes performance-article??
Zope will always fare badly in comparison to web servers that dont serve dynamic content. Zope's delivery will probably never be as fast as serving up static pages from the filesystem ala Apache or AOLServer. This is one of the reasons for ZEO. One of the other things in the wings that's being talked about on some Wiki somewhere is to build better caching in. -Original Message- From: Thomas Weholt [mailto:[EMAIL PROTECTED]] Sent: Thursday, June 29, 2000 6:06 AM To: '[EMAIL PROTECTED]' Subject: [Zope-dev] Comments on Zopes performance-article?? http://weblogs.userland.com/qube/2000/06/26 Just found this article were Zope scores really bad, - compared to the competition that is. Any comments? How can Zope improve performance in the future? I know Zope has alot of other good qualities, at least compared to Apache, but performance tends to be the thing that tips the scale when people chose platform, so how will this affect Zope? Thomas ___ 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] Comments on Zopes performance-article??
http://weblogs.userland.com/qube/2000/06/26 Just found this article were Zope scores really bad, - compared to the competition that is. Any comments? How can Zope improve performance in the future? I know Zope has alot of other good qualities, at least compared to Apache, but performance tends to be the thing that tips the scale when people chose platform, so how will this affect Zope? Thomas ___ 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] EMarket and 2.2.0b3
I'm sure a lot of this is because EMarket was a 1.x product that has seen relatively little change, in basic structure, since. I'm working on some patched to allow (1) ZClasses to act as MarketItems and Shoppers and (2) ZPatterns integration so that most objects can be optionally stored in RDBM or ZODB. .. I'll go ahead and checkin my ZClass stuff. I'm not running 2.2x much, since I'm really busy on other development... but I can at least see if the product installs! ;-) -steve "RDM" == R David Murray [EMAIL PROTECTED] writes: RDM OK, so I didn't get very far in tracking down what inside RDM EMarket is triggering the wierd auth behavior, because I had RDM to run a bunch of tests against b3, where the behavior has RDM changed from that of b2. RDM For this testing my method of determining if "things are RDM weird" is to see if I get prompted for authentication if I RDM access the "/manage_main" URL. Weird means I don't get RDM prompted. RDM Under b2, installing EMarket with a dummy empty __init__.py RDM file caused the weird behavour. Under b3, that test does RDM not. However, the EMarket __init__.py file with any of the RDM imports for the submodules uncommented *does* cause the weird RDM behavior. Farther than that I haven't gotten yet. RDM My tests give me some other interesting things to report, RDM however. After installing b3, I confirm that the site is RDM working and I can view the root index_html file normally. If RDM I then copy my test Data.fs from the b2 installation, the b3 RDM instance fails to show the root index_html, giving an error RDM message of a key error on URL on the last line of traverse in RDM BaseRequest.py. Now here's the weird thing: if I then RDM *delete* the Data.fs file, and restart Zope, *I continue to RDM get that same error*. I didn't try to track that any RDM further, but it unnerves me. RDM Second, the patch, supplied by someone else, that I reposted RDM here that fixed the "a_" KeyError after EMarket was installed RDM in b2, if applied to b3 *causes* that "a_" error to appear. RDM Since this patch was reportedly added to the CVS, I think RDM there is something here that needs to get cleared up before RDM 2.2 final. RDM I'll work on this some more tomorrow, but so far I'm nowhere RDM near finding what code might be involved in this set of RDM errors. RDM Has anyone seen the aforementioned "weird problem" with any RDM products other than EMarket and eTailor? RDM --RDM RDM ___ Zope-Dev RDM maillist - [EMAIL PROTECTED] RDM http://lists.zope.org/mailman/listinfo/zope-dev ** No cross RDM posts or HTML encoding! ** (Related lists - RDM http://lists.zope.org/mailman/listinfo/zope-announce RDM 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] adding attributes to a python product
Hi folks, I have a Python Product that I'm developing. During the course of development, I want to add a new attribute. All new instances get this attribute, as it is defined with a default value in the constructor. In addition, all instances that get edited via the web get the attribute, as the edit-processing method is defined to have a default value for this attribute. Is there any way of interacting with the ZODB persistence machinery to add the default attribute to all instances as they are brought out of persistent storage -- so that I can just restart Zope, and have all of my instances updated as I use them ? I can't find the right method or whatever in the ZODB on-line docs, or in the source. Thanks for any help. -- Steve Alexander Software Engineer Cat-Box limited http://www.cat-box.net ___ 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 Java-Script with DTML
Hi I`m trying to send a parameter to a java-script function and then use that parameter in the java-script function to look up a record-set in a database with a dtml-method. With no luck so far. Ex. script language="javascript1.2 function ShowStuff(params){ var text = "dtml-in expr="sqlMethod(some_id=params" !-- this does not work, of course. How I can I pass argument thru Javascript to the sqlMethod ?? --- alert (text); } /script !--- lots of DTML --- a href=".." onClick="ShowStuff(dtml-var some_id);".../a !--- lots of DTML --- The link sends an id to the java-script-method. A SQL method takes that id as argument and returns a recordset. Or, that`s what I want to happen. How can I get the sqlMethod to take the passed argument and return some data?? I get the thing to work by using static content, like dtml-in expr="sqlMethod(some_id='1')" But I need to pass the argument from somewhere else in the document. Oh, this was one big mess. Hope it makes some sense. Thomas ___ 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] update: CachePool 0.2.3
Hello, Just uploaded version 0.2.3 of the CachePool product. It fixes a serious bug wich crashed zope (a little too often) among some other improvements. For those of you who don't know, this product caches pages in an array, dependent of the calling URL and the query string. you can get it at http://www.zope.org/Members/neli/CachePool Carlos Neves [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] adding attributes to a python product
I have a Python Product that I'm developing. During the course of development, I want to add a new attribute. All new instances get this attribute, as it is defined with a default value in the constructor. In addition, all instances that get edited via the web get the attribute, as the edit-processing method is defined to have a default value for this attribute. Is there any way of interacting with the ZODB persistence machinery to add the default attribute to all instances as they are brought out of persistent storage -- so that I can just restart Zope, and have all of my instances updated as I use them ? I can't find the right method or whatever in the ZODB on-line docs, or in the source. Steve, The "best way" to do this is to define the new attribute (with its default value) as a class attribute. That way when you ask for the attribute on old instances you'll get the default value found in the class. If you change the attribute (through the web or whatever), the changed attribute will be saved *in the instance*. That way you don't even have to bother setting a default in the constructor (though it won't really hurt anything to do so). For example: # old class class Spam: """A spam object""" def cook(self): return 'cooked!' # new class - we want to add a 'color' attribute that defaults # to 'pink' and to be able to change the color, but we need old # instances to support this too. class Spam: """A spam object""" def cook(self): return 'cooked!' # class attribute - doing a getattr on 'color' will find # this for old instances. color='pink' def setColor(self, color='green'): # if this is called, the color attr will be saved in the # *instance*. The class default will not change. self.color=color Note that there is one caveat to this approach - if the attr that you want a default for is a _mutable_ Python object (like a dict or list), then you have to be careful not to modify the class attribute directly. In those cases you need to do a little more work: class Spam: """A spam object""" # A dict of spam flavors. flavors={} def addFlavor(self, name, desc): # We have to be careful here. We can't just say # 'self.flavors[name]=desc', because if we are an old # instance then self.flavors will give us the 'flavors' # *class attribute*. We don't want to mutate that, what # we really want to do is create flavors as an instance # attribute if we are getting the default. # set dict to either the 'flavors' from the _instance_ or # a fresh new dictionary. dict=self.__dict__.get('flavors', {}) # add the entry dict[name]=desc # this is important - the Zope persistence machinery can't # automatically know about changes to mutable builtin Python # types like dictionaries, so we have do a setattr on self # to make sure the changes to the dictionary are saved! self.flavors=dict Hope this helps! Brian Lloyd[EMAIL PROTECTED] Software Engineer 540.371.6909 Digital Creations http://www.digicool.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] Searching a relational database
James Henstridge [EMAIL PROTECTED] writes: On Sat, 24 Jun 2000, Thomas Weholt wrote: Hi, How can I search a relational database thru Zope? ( I`m using PostgreSQL 7.0.2 on Linux ). I have a DVD/VHS-organizing project that would be pretty useless if people couldn`t search for movies by entering just parts of the title. Ex. typing alien should show "Alien" and "Alien 3". If you just want to do a single search term, you could easily set up an SQL method that read something like: select * from table where title like '%dtml-sqlvar search%' (I hope that syntax works with MS SQL server). It is probably possible to get zope to escape special characters in the string for you as well. I use the regexp search option in Postgresql (~*) to do complex searches. Unfortunately this means that your users will have to write regular expressions. If anyone is interested in writing a booleans search syntax to regexp converter I would be very interested. Can ZCatalog be used for this? If I have a SQL-statement that returns all rows in a database, can ZCatalog index this? This would negate the benefits of having an SQL database (eg. indexing, etc). Just write an sql method that does the search. What I`m looking for is similar to full-text searching on MS SQL 7.0 etc. Tips, hints or pointers?? Thomas James. Richard ___ 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] adding attributes to a python product
On Thu, 29 Jun 2000, Steve Alexander wrote: Hi folks, Is there any way of interacting with the ZODB persistence machinery to add the default attribute to all instances as they are brought out of persistent storage -- so that I can just restart Zope, and have all of my instances updated as I use them ? In addition to the method Bryan detailed, you should look into the __setstate__() method. From http://www.zope.org/Members/michel/HowTos/ZODB-How-To: "When an object is activated by the object database and brought into memory, it's __setstate__() method is called. A Persistent class can override this method to initialize the object every time it is brought into memory. __setstate__() is also useful to upgrade an object from one version to another. If you add instance attributes to your product, older versions of the instances of that product will not have the new attribute. __setstate__ can check for the existance of new attributes, and create them with sane defaults in older versions of the instance." Thanks for any help. Hope this helps. --Jeff --- Jeff K. Hoffman 704.849.0731 x108 Chief Technology Officer mailto:[EMAIL PROTECTED] Going Virtual, L.L.C. http://www.goingv.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] Using Java-Script with DTML
--- In [EMAIL PROTECTED], Thomas Weholt [EMAIL PROTECTED] wrote: script language="javascript1.2 function ShowStuff(params){ var text = "dtml-in expr="sqlMethod(some_id=params" !-- this does not work, of course. How I can I pass argument thru Javascript to the sqlMethod ?? --- alert (text); } /script I think I know what you are talking about. But you have to really keep your mind straight about one thing: DTML runs with the CPU on the server side, JavaScript runs with the CPU on the client side. In other words, by the time you are running Javascript, you CAN'T access your database records. I have done a lot of things in displaying dynamic pull-down menus. E.g: you choose a state from one pull down menu, and the content of another pulldown menu is automatically changed to the list of cities within that particular state. When you click on a state, you CAN'T query your database for the list of its cities. It's too late, your code is already running on the client side. So what should you do? What you should do is to pre-generate JavaScript arrays, storing the names of all the cities for all the states. That being said, there is one more caveat. When you pre-render your database records into JavaScript arrays, you have to be careful about quoting. I don't know whether there are any string format quoting in DTML suitable for rendering into JavaScript (the dtml-sqltest ... type=string comes to mind, but I am not sure it works outside ZSQL methods), I ended up implementing my own external method to quote Python strings into JavaScript strings. If you still don't understand what I mean, consider a python string 'He said, "no".' stored in your DTML variable mystring, that is, something like: dtml-call "REQUEST.set('mystring', 'He said, "no".')" and you pre-render it into JavaScript code x = "dtml-var mystring"; It won't work. Because if you look at the source of your JavaScript, you will see: x = "He said, "no"."; regards, Hung Jung 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] Question
Hi, How I can upload 900 files into zope, in one shot ? I cannot use FTP, with the port 8021, I cannot use load site from itamar, because there is a bug. Maybe WebDav ? But I don't know how to use it. my email is: mailto:[EMAIL PROTECTED], if you want to help me to fix that problem, I searched a solutions since 3 days. -- Very truly yours, Jonathan Desp Atoma Matter will become Software http://www.atoma.f2s.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 )