Re: [Zope] Beginners Confusion
Hi Russell, Russell Winter wrote: Thanks for the prompt response, the reason behind keeping the users separate is that each team wants to feel that they have some control over their destiny's and we are happy to pander to this thought, they also each have a completely different set of visitors to the sites and wish to keep their sites separate. From our perspective, we also want to have that little more control over each team but in the way of resources but allow them some flexibility in their choices. Fair Enough. However, I had worked out that instances seemed to be the way to go, but I confused myself more by trying to setup and instance for a test user and failing dismally, the instance error'd in a number of ways, mostly I figured to do with permissions. This will just take time to work through I think. Yup, but it is the way to go... cheers, Chris -- Simplistix - Content Management, Zope Python Consulting - http://www.simplistix.co.uk ___ 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] Python Classes and Zope.
Paul Winkler wrote: 1) create a derived or wrapper class that inherits from Acquisition.Implicit or Acquisition.Explicit. This can either inherit from your existing class, or wrap it, as you prefer. You don't actually have to do this. 2) in the wrapper class, use ClassSecurityInfo() to declare the methods you need public or permission-protected, or use allowAny(). You can apply these, and module security declarations, from any piece of trusted code, to any other piece of FS-based code. You know, some days I wonder why it is that Zope is the only framework around that needs to distinguish between trusted and untrusted code. Nobody else seems to be looking at us with envy in this regard. Well, while I'd like to agree with you, I like having semi-trusted code, but I think Zope 3 does a much better job of this... cheers, Chris -- Simplistix - Content Management, Zope Python Consulting - http://www.simplistix.co.uk ___ 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] checking for elements in a list
Christopher Rivard wrote: http://groups.yahoo.com/group/zope/message/150345 I'm working offline, so can't see what you're refering to. The solution that I have come to is to simply set a cookie and serve up the correct fields based on the cookie: dtml-if 17 in list_map_dir_id and 21 not in list_map_dir_id dtml-call RESPONSE.setCookie(list_type,'lodge') dtml-elif 21 in list_map_dir_id and 17 not in list_map_dir_id dtml-call RESPONSE.setCookie(list_type,'resto') dtml-elif 21 in list_map_dir_id and 17 in list_map_dir_id dtml-call RESPONSE.setCookie(list_type,'restolodge') dtml-else dtml-call RESPONSE.setCookie(list_type,'other') /dtml-if dtml-in insert_listing1_sql id: dtml-var newid dtml-call REQUEST.set('list_map_list_id', newid) /dtml-in dtml-call insert_listing_map_sql dtml-call RESPONSE.redirect('add_listing2?list_id=%s'%(REQUEST['list_map_list_id'])) Oh my god! What the hell are you doing? Want some plyers to pull your fingernails out while you're at it?! I am sure there are more elegant ways to do this - the client wanted the data in a RDBMS for portabilityyah yah yah ...and it looks like you don't have a clue about relational databases. Sounds like you want to have an establishments table, a features table, and then learn to do a join on both to get the features for a given establishment. sheesh, I'm on the verge of tears having read the above... cheers, Chris -- Simplistix - Content Management, Zope Python Consulting - http://www.simplistix.co.uk ___ 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] checking for elements in a list
J Cameron Cooper wrote: Just make sure that the elements of the list you're getting are what you think they are. If you ask about the integer 17 and the list actually has a string 17 they won't match. You can either adjust what you test or use something like the 'int' function to cast. Also make sure the list isn't too long, otherwise do it as a dictionary and use has_key... cheers, Chris -- Simplistix - Content Management, Zope Python Consulting - http://www.simplistix.co.uk ___ 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] killing off individual Zope session
Dennis Allison wrote: We just had an example of a run away process with one of our authenticated users. What do you mean by this? If it's something to do with a relational database, you might be able to do something there... I would have liked to kill off the user's processing while leaving all the other users running. As Tres pointed out, can't really be done. Restarting Zope will do it... Chris -- Simplistix - Content Management, Zope Python Consulting - http://www.simplistix.co.uk ___ 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] zdsock
John Poltorak wrote: Because 'zdsock' is not an acceptable name. I am running on OS/2 and the path name must start with '\\socket\\'. Oooo, ow, that's gonna hurt... Chris -- Simplistix - Content Management, Zope Python Consulting - http://www.simplistix.co.uk ___ 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] add multiple images to zope folder
I'd use WebDAV. If you want security, tunnel the WebDAV port over ssh. cheers, Chris Chris Purves wrote: Hello, Is there a way to add multiple images to a zope folder instead of adding one at a time? -- Take care, eh. Chris ___ 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 ) -- Simplistix - Content Management, Zope Python Consulting - http://www.simplistix.co.uk ___ 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] Python Classes and Zope.
Chris McDonough wrote: Not really, and that's why Zope 3 has avoided through the web code so far. I hope this avoidance continues at least in the core, whatever that is, but I see rumblings every so often about why this is a can't-live-without thing (with which I strongly disagree). Well, TTW coding via WebDAV, for example, is something that I don't think I could live without :-S Chris -- Simplistix - Content Management, Zope Python Consulting - http://www.simplistix.co.uk ___ 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: why will FastCGI not be supported in the Future.
Andrew Milton wrote: If there's noone around who can maintain it, then just say that. Don't say there's 'a better way', because I can guarantee you the people using FCGI are using it for a reason, I haven't seen anyone come up with real justification for using FCGI... I can imagine a pretty big set of people running Zope via FCGI who are not running Apache.. I can also imagine that magical code fairies fight with magical code trolls to the death to decide what pieces of code stay and which pieces go. Uh? I'm not sure whether to ask for some of what you're on or just run away screaming ;-) Chris -- Simplistix - Content Management, Zope Python Consulting - http://www.simplistix.co.uk ___ 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 Message Board
Squishdot's still there, it's just so stable that it hasn't needed fixing for ages now ;-) Michael Haubenwallner wrote: John Poltorak wrote: What Message Board product is recommended for use with Zope? I think zForum at http://www.zforum.org is the only one alive. Michael -- Simplistix - Content Management, Zope Python Consulting - http://www.simplistix.co.uk ___ 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: why will FastCGI not be supported in the Future.
--On 5. Dezember 2005 07:51:17 + Chris Withers [EMAIL PROTECTED] wrote: Andrew Milton wrote: If there's noone around who can maintain it, then just say that. Don't say there's 'a better way', because I can guarantee you the people using FCGI are using it for a reason, I haven't seen anyone come up with real justification for using FCGI... FCGI is deprecated effective Zope 2.9. -aj pgpMOEEV52pNP.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 )
[Zope] Zope Py23-Py24 problem...
Hi ! I have home pc, and other pc in my corp. The home pc have py2.3, the work pc have py2.4. I installed Zope 2.8.4 in every system. I have been building a zope site in my home machine. Then I copy to usb pendrive (data.fs), and move to corp machine. But when I want to start this site in my corp machine, it is show error message: python23.dll is not found. How can I import this database ? Or I need to drop my site structure, and need to begin the work again ? Please help me. Thanks for every solution. dd ___ 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 Py23-Py24 problem...
On 05.12.05 11:42:19, Durumdara wrote: Hi ! I have home pc, and other pc in my corp. The home pc have py2.3, the work pc have py2.4. I installed Zope 2.8.4 in every system. I have been building a zope site in my home machine. Then I copy to usb pendrive (data.fs), and move to corp machine. But when I want to start this site in my corp machine, it is show error message: python23.dll is not found. I think you need to use the same python version as on your home PC. Or try exporting to a zexp and then reimporting. But be aware that running Zope 2.7 oder 2.8 with Python 2.4 is not supported and you won't get much help here or anywhere else with that combination. Andreas -- Another good night not to sleep in a eucalyptus tree. ___ 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] Hooks for methods other than GET/POST on port 80?
Dieter Maurer wrote: Roman Suzi wrote at 2005-12-3 21:56 +0200: I am looking for a way in Zope to receive HTTP-requests with, eg, DELETE and PUT in the object method. Zope (2.7.x) seems to intercept these and issue Not authorised. DELETE and PUT are WebDAV methods (and defined in webdav.Resource.Resouce). You have the usual hook: override the definition in your class. Do not forget to assign a new permission to your new method definitions (otherwise, the 'Unauthorized' will remain). Advice taken, thanks. However, when I tried to do it and Zope freezes (that is, the whole Zope server freezes!). never saw anything like that before... After restarting Zope the same thing happened again. Probably it's a bug. Roman Suzi ___ 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 Py23-Py24 problem...
Hi ! So you say that I must use Zope 2.x (x=7,8) with Python 2.3 versions ? Can I use Zope3 with Python 2.4 ? Or I forget it, and I need to use Py2.3 for everything ? (I have wx, local, and other developments, so if I need to change that, I must change everything...) Thanks for help: dd I think you need to use the same python version as on your home PC. Or try exporting to a zexp and then reimporting. But be aware that running Zope 2.7 oder 2.8 with Python 2.4 is not supported and you won't get much help here or anywhere else with that combination. Andreas Andreas Pakulat wrote: On 05.12.05 11:42:19, Durumdara wrote: Hi ! I have home pc, and other pc in my corp. The home pc have py2.3, the work pc have py2.4. I installed Zope 2.8.4 in every system. I have been building a zope site in my home machine. Then I copy to usb pendrive (data.fs), and move to corp machine. But when I want to start this site in my corp machine, it is show error message: python23.dll is not found. ___ 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 Py23-Py24 problem...
--On 5. Dezember 2005 13:56:28 +0100 Durumdara [EMAIL PROTECTED] wrote: Hi ! So you say that I must use Zope 2.x (x=7,8) with Python 2.3 versions ? This is documented and discussed a bunch of times (check the archives or read the installation documentation). Can I use Zope3 with Python 2.4 ? Depends on the version. At least the upcoming Zope 3.2 version requires Python 2.4. -aj pgp4xZPBE9Z68.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] Zope Py23-Py24 problem...
On 05.12.05 12:54:03, Durumdara wrote: Hi ! Please reply to the list So you say that I must use Zope 2.x (x=7,8) with Python 2.3 versions ? You don't have to, from what I read here on another Zope ML it can work. But as soon as you have problems and you want to get help here you're better off using Python 2.3 with Zope 2.x (x 9) Can I use Zope3 with Python 2.4 ? Not sure, but I think yes. See the INSTALL.txt it should have a paragraph about the Python version to use. Andreas -- Change your thoughts and you change your world. ___ 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 Py23-Py24 problem...
On 12/5/05, Durumdara [EMAIL PROTECTED] wrote: Hi ! I have home pc, and other pc in my corp. The home pc have py2.3, the work pc have py2.4. I installed Zope 2.8.4 in every system. I have been building a zope site in my home machine. Then I copy to usb pendrive (data.fs), and move to corp machine. But when I want to start this site in my corp machine, it is show error message: python23.dll is not found. Huh? Did you copy only the Data.fs? What OS do you run on your work PC? Did the Zope work on your Zope PC before you copied the Data.fs? -- Lennart Regebro, Nuxeo http://www.nuxeo.com/ CPS Content Management http://www.cps-project.org/ ___ 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 Py23-Py24 problem...
Hi ! Yes, everything is working. That is working in older versions: I create instance with mkinstance.py, and copy the data.fs to it. Every PC is WinXP, only different is Python version number. I have been probed python 2.4, and it is working good, that I thinking about that I change (upgrade) to it. But that have some dependecies like this: some packages are working good only in Py2.3... dd Huh? Did you copy only the Data.fs? What OS do you run on your work PC? Did the Zope work on your Zope PC before you copied the Data.fs? -- Lennart Regebro, Nuxeo http://www.nuxeo.com/ CPS Content Management http://www.cps-project.org/ ___ 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 Py23-Py24 problem...
On 12/5/05, Durumdara [EMAIL PROTECTED] wrote: Hi ! Yes, everything is working. That is working in older versions: I create instance with mkinstance.py, and copy the data.fs to it. Every PC is WinXP, only different is Python version number. I have been probed python 2.4, and it is working good, that I thinking about that I change (upgrade) to it. But that have some dependecies like this: some packages are working good only in Py2.3... So, it's the packages that are not working, and not the Data.fs, as you said before? Did you copy the packages over as well? In that case, they contain a compiled pyc-file, which requires 2.3. Delete all pyc files (or better reinstall all products from sratch). -- Lennart Regebro, Nuxeo http://www.nuxeo.com/ CPS Content Management http://www.cps-project.org/ ___ 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: Which Zope version is installed?
In your SOFTWARE_HOME (check its value in /Control_Panel in ZMI) read the file 'version.txt' In certain versions of the Zope 2.7 releases the version.txt file was mucked up; looking at the top of the CHANGES.txt (in the doc/ directory) is a more reliable way of telling what version you have, including subversion checkouts. -- 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] Hooks for methods other than GET/POST on port 80?
Dieter Maurer wrote: Roman Suzi wrote at 2005-12-3 21:56 +0200: I am looking for a way in Zope to receive HTTP-requests with, eg, DELETE and PUT in the object method. Zope (2.7.x) seems to intercept these and issue Not authorised. DELETE and PUT are WebDAV methods (and defined in webdav.Resource.Resouce). You have the usual hook: override the definition in your class. Do not forget to assign a new permission to your new method definitions (otherwise, the 'Unauthorized' will remain). This is what freezes Zope: Traceback (most recent call last): File /usr/local/lib/python2.3/logging/__init__.py, line 674, in emit msg = self.format(record) File /usr/local/lib/python2.3/logging/__init__.py, line 567, in format return fmt.format(record) File /usr/local/lib/python2.3/logging/__init__.py, line 369, in format s = s + self.formatException(record.exc_info) File /usr/local/lib/python2.3/logging/__init__.py, line 342, in formatException traceback.print_exception(ei[0], ei[1], ei[2], None, sio) File /usr/local/lib/python2.3/traceback.py, line 123, in print_exception print_tb(tb, limit, file) File /usr/local/lib/python2.3/traceback.py, line 68, in print_tb line = linecache.getline(filename, lineno) File /usr/local/lib/python2.3/linecache.py, line 14, in getline lines = getlines(filename) RuntimeError: maximum recursion depth exceeded Regards, Roman Suzi ___ 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] Finding a match in a large dataset - btrees?
On Mon, Dec 05, 2005 at 04:57:03PM +1300, Cameron Beattie wrote: I have a large set of data (that will be stored in MySQL) that I wish to match to and am wondering what the best method is. Assume the following data in table LOCATION_MATCH: LOCATION_IDLOCATION_PATTERNPARENT_ID 106 11410 13211 12911 14113 15213 The string 6438 should return 11, 6421 14, 6422 15 and 6499 12. I stopped reading here because I couldn't make any sense of the example. How does 6438 return 11? -- Paul Winkler http://www.slinkp.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] Finding a match in a large dataset - btrees?
On 12/5/05, Cameron Beattie [EMAIL PROTECTED] wrote: I have a large set of data (that will be stored in MySQL) that I wish to match to and am wondering what the best method is. Assume the following data in table LOCATION_MATCH: LOCATION_IDLOCATION_PATTERNPARENT_ID 106 11410 13211 12911 14113 15213 The string 6438 should return 11, 6421 14, 6422 15 and 6499 12. Eh, what? OK, I understand what is happening, but why? It seems to me that this is an implementation of a btree, but why? SQL databases have indexes, why not just use them? :) I've read a bit about btrees on the zope wiki and wonder if that's the best way. Probably, but only if you actually let them do the indexing. :-) -- Lennart Regebro, Nuxeo http://www.nuxeo.com/ CPS Content Management http://www.cps-project.org/ ___ 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 Calendar
On Mon, Dec 05, 2005 at 01:17:06PM +0800, Bakhtiar A Hamid wrote: I wanted something which looks like Plone Calendar - http://www.zope.org/Members/teyc/CalendarTag this has a howto (or is it in the readme), and with the necessary css, can look pretty much like plone's I'd like to see more examples of what can be done. Is there any way to create a calendar of events which are automatically highlighted when displaying the calendar? -- John ___ 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] zdsock
On Mon, Dec 05, 2005 at 08:50:30AM +, Chris Withers wrote: John Poltorak wrote: Because 'zdsock' is not an acceptable name. I am running on OS/2 and the path name must start with '\\socket\\'. Oooo, ow, that's gonna hurt... Zope itself works fine when started via runzope, so what is the problem in trying to provide an alternate socket name? zdctl is supposed to accept an alternative socket name:- -s/--socket-name SOCKET -- Unix socket name for client (default zdsock) Unfortunately, I can't figure out any way to make use of this option. Chris -- Simplistix - Content Management, Zope Python Consulting - http://www.simplistix.co.uk -- John ___ 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 Calendar
On 12/5/05, John Poltorak [EMAIL PROTECTED] wrote: Is there any way to create a calendar of events which are automatically highlighted when displaying the calendar? Highlighted? And also, my earlier question begs for answer. What do you mean with looks like and works like? Is there a Zope Calendar app available which looks and works like Plone Calendar? I think this would be easier if you were more specific of what kind of features you want. -- Lennart Regebro, Nuxeo http://www.nuxeo.com/ CPS Content Management http://www.cps-project.org/ ___ 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] Finding a match in a large dataset - btrees?
I cannot make any sense out of your example data. Since you already have the data in a MySQL table, I would think the best way to find the match would be to make a MySQL query. On Mon, 5 Dec 2005, Cameron Beattie wrote: I have a large set of data (that will be stored in MySQL) that I wish to match to and am wondering what the best method is. Assume the following data in table LOCATION_MATCH: LOCATION_IDLOCATION_PATTERNPARENT_ID 106 11410 13211 12911 14113 15213 The string 6438 should return 11, 6421 14, 6422 15 and 6499 12. I've read a bit about btrees on the zope wiki and wonder if that's the best way. However I am struggling with the basics: 1. How do I get the data from MySQL into a btree in Zope? Something like: from BTrees.IIBTree import * t = IIBTree() t.update(context.select_from_LOCATION_MATCH) # errr, no 2. How do I find the matching node i.e. when I want to know that 6422 relates to location_id 15? Any help or pointers to further documentation would be appreciated. Regards Cameron ___ 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 )
Re: [Zope] add multiple images to zope folder
I once started down that path with FTP. I use HomeSite, as well, to save via FTP. I investigated a Linux package called Delegate, that would provide a rev-proxy for FTP over SSL, in which normal FTP clients with SSL could transfer files. www.delegate.org I didn't continue, priorities and all. Maybe a WebDAV client over SSL would be easier, depends on your needs. -Jon Chris Purves wrote: On 04/12/05, Jonathan Cyr [EMAIL PROTECTED] wrote: Use FTP, Open Internet Explorer, type ftp://zopeusername:[EMAIL PROTECTED]:8021/directory/ and drag and drop from explorer to ie, zope assigns them as images automatically. Any FTP client will do, Filezilla is nice/free, as well. (filezilla.sourceforge.net) Substitute 8021 with your Zope's FTP port. I use it regularly for uploading website graphical components, a nice shortcut. That looks like exactly what I want, but is it possible to make the connection secure? -- Take care, eh. Chris ___ 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 ) -- Jonathan Cyr http://www.cyr.info http://www.weddingweblog.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] Adding TextIndexNG 3.1.1 error
Zope 2.8.0 Python 2.3.5 RHEL 3 I installed TextIndexNG 3.1.1 and associated extension_modules without a problem. Trying to add a TextIndexNG index to my catalog returns: Error Type: ComponentLookupError Error Value: 'Utilities' I'm pretty sure I followed all instructions and I've installed and used previous versions of TextIndexNG without a problem on other instances of Zope 2.8.x. Can anyone help figure out what's going wrong? Traceback follows... Traceback (innermost last): Module ZPublisher.Publish, line 113, in publish Module ZPublisher.mapply, line 88, in mapply Module ZPublisher.Publish, line 40, in call_object Module Shared.DC.Scripts.Bindings, line 311, in __call__ Module Shared.DC.Scripts.Bindings, line 348, in _bindAndExec Module Products.PageTemplates.PageTemplateFile, line 110, in _exec Module Products.PageTemplates.PageTemplate, line 102, in pt_render - PageTemplateFile at /test/Catalog/manage_addTextIndexNG3Form Module TAL.TALInterpreter, line 190, in __call__ Module TAL.TALInterpreter, line 234, in interpret Module TAL.TALInterpreter, line 611, in do_loop_tal Module Products.PageTemplates.TALES, line 206, in setRepeat Module Products.PageTemplates.TALES, line 221, in evaluate - URL: manage_addTextIndexNG3Form - Line 155, Column 8 - Expression: standard:'context/get_splitters' - Names: {'container': App.ProductContext.__FactoryDispatcher__ object at 0xb64020cc, 'context': App.ProductContext.__FactoryDispatcher__ object at 0xb64020cc, 'default': Products.PageTemplates.TALES.Default instance at 0xb6c6bdcc, 'here': App.ProductContext.__FactoryDispatcher__ object at 0xb64020cc, 'loop': Products.PageTemplates.TALES.SafeMapping object at 0xb613e3cc, 'modules': Products.PageTemplates.ZRPythonExpr._SecureModuleImporter instance at 0xb6c7ec6c, 'nothing': None, 'options': {'args': ()}, 'repeat': Products.PageTemplates.TALES.SafeMapping object at 0xb613e3cc, 'request': HTTPRequest, URL=http://localhost:8080/test/Catalog/manage_addProduct/TextIndexNG3/manage_addTextIndexNG3Form, 'root': OFS.Application.Application object at 0xb644f32c, 'template': PageTemplateFile at /test/Catalog/manage_addTextIndexNG3Form, 'traverse_subpath': [], 'user': garth} Module Products.PageTemplates.Expressions, line 183, in __call__ Module Products.PageTemplates.Expressions, line 178, in _eval Module Products.PageTemplates.Expressions, line 85, in render Module Products.TextIndexNG3, line 49, in get_splitters Module zope.component, line 87, in getUtilitiesFor Module zope.component, line 68, in getService Module zope.component.service, line 109, in getService ComponentLookupError: 'Utilities' ___ 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] Adding TextIndexNG 3.1.1 error
--On 5. Dezember 2005 13:34:15 -0500 Garth B. [EMAIL PROTECTED] wrote: Zope 2.8.0 Python 2.3.5 RHEL 3 I installed TextIndexNG 3.1.1 and associated extension_modules without a problem. Trying to add a TextIndexNG index to my catalog returns: Error Type: ComponentLookupError Error Value: 'Utilities' I am still missing a detailed description from your side how to reproduce this behaviour on nacked Plone or Zope installation. -aj pgpm6BT69Pbk2.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] Adding TextIndexNG 3.1.1 error
Sorry, I created a ZCatalog and when choosing TextIndexNG3 from the Add dropdown in my ZCatalog's Indexes tab, it immediately gives me this error. Thanks for any help you can provide! I'll repeat the traceback below: Traceback (innermost last): Module ZPublisher.Publish, line 113, in publish Module ZPublisher.mapply, line 88, in mapply Module ZPublisher.Publish, line 40, in call_object Module Shared.DC.Scripts.Bindings, line 311, in __call__ Module Shared.DC.Scripts.Bindings, line 348, in _bindAndExec Module Products.PageTemplates.PageTemplateFile, line 110, in _exec Module Products.PageTemplates.PageTemplate, line 102, in pt_render - PageTemplateFile at /test/Catalog/manage_addTextIndexNG3Form Module TAL.TALInterpreter, line 190, in __call__ Module TAL.TALInterpreter, line 234, in interpret Module TAL.TALInterpreter, line 611, in do_loop_tal Module Products.PageTemplates.TALES, line 206, in setRepeat Module Products.PageTemplates.TALES, line 221, in evaluate - URL: manage_addTextIndexNG3Form - Line 155, Column 8 - Expression: standard:'context/get_splitters' - Names: {'container': App.ProductContext.__FactoryDispatcher__ object at 0xb64020cc, 'context': App.ProductContext.__FactoryDispatcher__ object at 0xb64020cc, 'default': Products.PageTemplates.TALES.Default instance at 0xb6c6bdcc, 'here': App.ProductContext.__FactoryDispatcher__ object at 0xb64020cc, 'loop': Products.PageTemplates.TALES.SafeMapping object at 0xb613e3cc, 'modules': Products.PageTemplates.ZRPythonExpr._SecureModuleImporter instance at 0xb6c7ec6c, 'nothing': None, 'options': {'args': ()}, 'repeat': Products.PageTemplates.TALES.SafeMapping object at 0xb613e3cc, 'request': HTTPRequest, URL=http://localhost:8080/test/Catalog/manage_addProduct/TextIndexNG3/manage_addTextIndexNG3Form, 'root': OFS.Application.Application object at 0xb644f32c, 'template': PageTemplateFile at /test/Catalog/manage_addTextIndexNG3Form, 'traverse_subpath': [], 'user': garth} Module Products.PageTemplates.Expressions, line 183, in __call__ Module Products.PageTemplates.Expressions, line 178, in _eval Module Products.PageTemplates.Expressions, line 85, in render Module Products.TextIndexNG3, line 49, in get_splitters Module zope.component, line 87, in getUtilitiesFor Module zope.component, line 68, in getService Module zope.component.service, line 109, in getService ComponentLookupError: 'Utilities' On 12/5/05, Andreas Jung [EMAIL PROTECTED] wrote: --On 5. Dezember 2005 13:34:15 -0500 Garth B. [EMAIL PROTECTED] wrote: Zope 2.8.0 Python 2.3.5 RHEL 3 I installed TextIndexNG 3.1.1 and associated extension_modules without a problem. Trying to add a TextIndexNG index to my catalog returns: Error Type: ComponentLookupError Error Value: 'Utilities' I am still missing a detailed description from your side how to reproduce this behaviour on nacked Plone or Zope installation. -aj ___ 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] Adding TextIndexNG 3.1.1 error
--On 5. Dezember 2005 14:15:39 -0500 Garth B. [EMAIL PROTECTED] wrote: Sorry, I created a ZCatalog and when choosing TextIndexNG3 from the Add dropdown in my ZCatalog's Indexes tab, it immediately gives me this error. Works like a charm..Somehow your Zope installation must be borked. Try with again with a fresh 2.8 installation. -aj pgpXpYR1szZnm.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] Adding TextIndexNG 3.1.1 error
Sigh... figures... I'll use this as an excuse to upgrade to 2.8.4 Thanks! On 12/5/05, Andreas Jung [EMAIL PROTECTED] wrote: --On 5. Dezember 2005 14:15:39 -0500 Garth B. [EMAIL PROTECTED] wrote: Sorry, I created a ZCatalog and when choosing TextIndexNG3 from the Add dropdown in my ZCatalog's Indexes tab, it immediately gives me this error. Works like a charm..Somehow your Zope installation must be borked. Try with again with a fresh 2.8 installation. -aj ___ 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 Calendar
On Mon, Dec 05, 2005 at 05:08:19PM +0100, Lennart Regebro wrote: On 12/5/05, Lennart Regebro [EMAIL PROTECTED] wrote: I think this would be easier if you were more specific of what kind of features you want. Or you can just use CalZope. ;-) It is the most superfantasticmegacool calendar software ever. I know, because Martijn Faassen and I wrote it. :-D http://www.cps-project.org/sections/projects/calendar_server/features/ Is there so,ething missing here? http://www.cps-project.org/sections/about/screenshots/cps_sites_screenshots/ Is there an example of it in use anywhere? Can't tell if it works with just Zope or whether it needs Plone. Unbiasedly: Lennart Regebro, Nuxeo -- John ___ 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] Accessing a Subfolder of a Parent Folder
How do I access the subfolder of a parent folder? I am using the following but cannot seem to access the folder object: dtml-call REQUEST.set('parentFolder', PARENTS[2].id + 'Test') dtml-call REQUEST.get('parentFolder').initialize_vars() I get the following error: Error Type: AttributeError Error Value: 'str' object has no attribute 'initialize_vars' I understand that a DTML method cannot be called on a string, but how do I obtain the object that represents the subfolder 'Test'? Any help would be appreciated. Thanks. - Asad ___ 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] Accessing a Subfolder of a Parent Folder
dtml-call REQUEST.set('parentFolder', PARENTS[2].id + 'Test') dtml-call _.getitem(REQUEST.get('parentFolder')).initialize_vars() On 12/5/05, Asad Habib [EMAIL PROTECTED] wrote: How do I access the subfolder of a parent folder? I am using the following but cannot seem to access the folder object: dtml-call REQUEST.set('parentFolder', PARENTS[2].id + 'Test') dtml-call REQUEST.get('parentFolder').initialize_vars() I get the following error: Error Type: AttributeError Error Value: 'str' object has no attribute 'initialize_vars' I understand that a DTML method cannot be called on a string, but how do I obtain the object that represents the subfolder 'Test'? Any help would be appreciated. Thanks. - Asad ___ 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 ) -- Peter Bengtsson, work www.fry-it.com home www.peterbe.com hobby www.issuetrackerproduct.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] Accessing a Subfolder of a Parent Folder
try googling 'aq_parent'. Jonathan - Original Message - From: Asad Habib [EMAIL PROTECTED] To: zope@zope.org Sent: Monday, December 05, 2005 5:50 PM Subject: [Zope] Accessing a Subfolder of a Parent Folder How do I access the subfolder of a parent folder? I am using the following but cannot seem to access the folder object: dtml-call REQUEST.set('parentFolder', PARENTS[2].id + 'Test') dtml-call REQUEST.get('parentFolder').initialize_vars() I get the following error: Error Type: AttributeError Error Value: 'str' object has no attribute 'initialize_vars' I understand that a DTML method cannot be called on a string, but how do I obtain the object that represents the subfolder 'Test'? Any help would be appreciated. Thanks. - Asad ___ 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 )
Re: [Zope] FOLLOWUP: 120MB file import failures
Hello, I found the source of my problem uploading a large file to ZODB over DAV and an a workaround that shouldn't have worked but worked. For those who are interested: For completeness: I would like to put a 120MB file into ZODB and it is constantly failing. But you should have learned that you cannot simply say is failing but must describe precisely (error information, traceback) *how* it is failing... Correct Dieter, I was vague but it indeed would progress and then fail. Goliath, a mac web dav client, would report Unknown connection error and the Finder would report ... cannot be completed... one or more required items not found (error code -43) I apologize that I am not familiar with Zope's traceback. Thank you to Tino for providing a script to copy files into ZODB. This solves a few other issues. So. I knew to watch my /tmp directory and it was not being used. It turns out that Python (presumably, not Zope) was using /var/tmp (over RAM, given that large-file-threshold in zope.conf was lower than 120MB). I linked /var/tmp to /tmp and oddly it started using /usr/??? but at least it worked because there was more than 120MB available there. I am not quite sure where it ended up putting it. (seemingly not /var in the zope instance) The solution appears to be that python can use the TMPDIR variable to specify where tmp should default to (reportedly it will try various locations) but, I am not clear how I can add this to Zope's rc script to declare it. I tried it as simply setting the environment variable set TMPDIR=/tmp but that gave warnings about the startup logic. 1. Should TMPDIR work? 2. Where should I declare it when using rc scripts? 3. Any chance zope.conf can use it? References: http://mail.zope.org/pipermail/zope-dev/2005-March/024534.html http://mail.zope.org/pipermail/zope-dev/2005-March/024532.html Appreciated, Michael. ___ 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] oddity with zope and webdav
I have a zope instance listening on localhost. I use apache and fastcgi to reach zope. Now I would like to provide webdav. Since my apache is already doing ssl, I wanted webdav connections to also go through apache. when I use cadaver and connect to my zope zope through apache, all works well even though I have specified in my zope.conf file that webdav listen on localhost:8088 (it seems that cadaver is smart enough working through the fastcgi interface to just work). When attempting to using dreamweaver mx or windows webfolders to connect to zope I get an error. So I attempted to use an apache proxy pass directive to campture all urls at myzopeserver.edu:8088/webdav back to localhost:8088. This had no effect. cadaver was still able to work. Dreamweaver (using webdav site setup) and windows webfolders still failed. What deep magic do I need to make dav work through apache? ( would prefer to have all things go through fastcgi but I understand the trend is to use proxy-pass ) -- David BearWhat's the difference between private knowledge and public knowledge? ___ 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] Translating a webpage
I'm wondering if someone can point me in the direction of some documentation that will tell me the best way to translate a web page into multiple languages using Zope Page Templates. In previous sites we've done in DTML we used a 'phrases' table in our MySQL database that contained phrases in each language the site required. We then used sql methods and a dtml-let statement to create a list of the phrases used on a certain page. I'm considering using the same basic idea for a page template site, but am wondering if there is a better way of doing translations. I've read about using .po files. Is there an easy way to hook these up to Zope? Any help would be greatly appreciated. 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] Finding a match in a large dataset - btrees?
Thanks for the many replies. I apologise for the original message which was obviously very unclear - I will try to correct that. Basically I want to match a telephone number to a rate table. Assume the following rate table: Telephone codeRate 6491 64212 64222.5 64 1.5 The following table sets out the appropriate rate to return for a given telephone number Dialled numberReturned rate 649123 1 6431231.5 6422 64221 2.5 Things to note: If there is no match the right-most digit is removed until there is a match e.g. 643123 matches to 64 The length of the dialled number is not consistent e.g. 649123 vs 64221 The length of the telephone code is not consistent e.g. 64 vs 6422 I want to do this frequently and at low cost i.e. ideally in memory. Perhaps the best way is to write a procedure in MySQL however I am interested in any python-based alternatives. Regards Cameron ___ 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] add multiple images to zope folder
On 05/12/05, Chris Withers [EMAIL PROTECTED] wrote: I'd use WebDAV. If you want security, tunnel the WebDAV port over ssh. Thanks. I was able to get WebDAV over SSL working. -- Take care, eh. Chris ___ 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] add multiple images to zope folder
On 06/12/05, Jonathan Cyr [EMAIL PROTECTED] wrote: I once started down that path with FTP. I use HomeSite, as well, to save via FTP. I investigated a Linux package called Delegate, that would provide a rev-proxy for FTP over SSL, in which normal FTP clients with SSL could transfer files. www.delegate.org I didn't continue, priorities and all. Maybe a WebDAV client over SSL would be easier, depends on your needs. Yes, that's exactly what I was looking for. I'm already using Apache as a proxy for Zserver, so it didn't take much to get SSL working as well. Thanks, everyone for your help. -- Take care, eh. Chris ___ 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] oddity with zope and webdav
On 06/12/05, David Bear [EMAIL PROTECTED] wrote: I have a zope instance listening on localhost. I use apache and fastcgi to reach zope. Now I would like to provide webdav. Since my apache is already doing ssl, I wanted webdav connections to also go through apache. when I use cadaver and connect to my zope zope through apache, all works well even though I have specified in my zope.conf file that webdav listen on localhost:8088 (it seems that cadaver is smart enough working through the fastcgi interface to just work). When attempting to using dreamweaver mx or windows webfolders to connect to zope I get an error. So I attempted to use an apache proxy pass directive to campture all urls at myzopeserver.edu:8088/webdav back to localhost:8088. This had no effect. cadaver was still able to work. Dreamweaver (using webdav site setup) and windows webfolders still failed. What deep magic do I need to make dav work through apache? ( would prefer to have all things go through fastcgi but I understand the trend is to use proxy-pass ) I just got this working myself, although I am using apache as a proxy, not fastcgi. If you already have ssl working with apache and can access zope through apache without ssl, it shouldn't be difficult. The main thing is to add a virtual host in your apache config for SSL and modify the rewrite line to use https:. I found the following document helpful: http://www.zope.org/Members/tmckibben/HowTo.2004-04-13.0659 It uses FastCGI, so it should more closely match your setup than mine -- Take care, eh. Chris ___ 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] Finding a match in a large dataset - btrees?
--On 6. Dezember 2005 14:55:08 +1300 Cameron Beattie [EMAIL PROTECTED] wrote: I want to do this frequently and at low cost i.e. ideally in memory. Perhaps the best way is to write a procedure in MySQL however I am interested in any python-based alternatives. I pointed you already to the BTrees documentation. -aj pgprF4vRE4Ede.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] Finding a match in a large dataset - btrees?
--On 6. Dezember 2005 14:55:08 +1300 Cameron Beattie [EMAIL PROTECTED] wrote: I want to do this frequently and at low cost i.e. ideally in memory. Perhaps the best way is to write a procedure in MySQL however I am interested in any python-based alternatives. Your problem is more an algorithmic problem than q question of the data representation. Store the mapping as some BTree (possibly IIBTree using normalized integers for the values). Then you have to iterate over all prefixes of the dialed number starting with the longest prefix to the smallest prefix. Then perform a lookup of the prefix in your BTree... this is should not take more than five lines of code and requires a maximum of #(length_of_dialed_number) comparisons. If you want it more complicated construct a tree and you'll have a logarithmic number of comparisons. I doubt that it is worth the effort since the first solution should be fast enough unless your dialed number is hundreds of digits long :-) -aj pgp2ARghXrI2q.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] Finding a match in a large dataset - btrees?
Am Dienstag, den 06.12.2005, 14:55 +1300 schrieb Cameron Beattie: Thanks for the many replies. I apologise for the original message which was obviously very unclear - I will try to correct that. ... I want to do this frequently and at low cost i.e. ideally in memory. Perhaps the best way is to write a procedure in MySQL however I am interested in any python-based alternatives. *hint* use postgres instead where you can write stored functions in python too :-) (With some little modifications on the zope database adaptor you could even return a dictionary or btree object as result of your query then :-) SCNR 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 )
[Zope] Re: oddity with zope and webdav
On Mon, 05 Dec 2005 18:17:38 -0700, David Bear wrote: I have a zope instance listening on localhost. I use apache and fastcgi to reach zope. Now I would like to provide webdav. Since my apache is already doing ssl, I wanted webdav connections to also go through apache. when I use cadaver and connect to my zope zope through apache, all works well even though I have specified in my zope.conf file that webdav listen on localhost:8088 (it seems that cadaver is smart enough working through the fastcgi interface to just work). When attempting to using dreamweaver mx or windows webfolders to connect to zope I get an error. So I attempted to use an apache proxy pass directive to campture all urls at myzopeserver.edu:8088/webdav back to localhost:8088. This had no effect. cadaver was still able to work. Dreamweaver (using webdav site setup) and windows webfolders still failed. What deep magic do I need to make dav work through apache? ( would prefer to have all things go through fastcgi but I understand the trend is to use proxy-pass ) I believe this patch is required if using recent WinXP, due to Microsoft webdav breakages: http://teyc.editthispage.com/2005/06/02 It fixed webdav for web folder for me. Add the extra line into the OPTIONS method of the file mentioned, where other headers are being set. -- Sam. ___ 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-Checkins] SVN: Zope/branches/2.9/ ObjectManager now has an hasObject method to test presence. This
Log message for revision 40536: ObjectManager now has an hasObject method to test presence. This brings it in line with BTreeFolder. Changed: U Zope/branches/2.9/doc/CHANGES.txt U Zope/branches/2.9/lib/python/OFS/ObjectManager.py U Zope/branches/2.9/lib/python/OFS/interfaces.py U Zope/branches/2.9/lib/python/OFS/tests/testObjectManager.py -=- Modified: Zope/branches/2.9/doc/CHANGES.txt === --- Zope/branches/2.9/doc/CHANGES.txt 2005-12-05 13:54:19 UTC (rev 40535) +++ Zope/branches/2.9/doc/CHANGES.txt 2005-12-05 15:07:46 UTC (rev 40536) @@ -26,6 +26,9 @@ Features added + - ObjectManager now has an hasObject method to test presence. This +brings it in line with BTreeFolder. + - Using FastCGI is officially deprecated - Improved logging of ConflictErrors. All conflict errors are Modified: Zope/branches/2.9/lib/python/OFS/ObjectManager.py === --- Zope/branches/2.9/lib/python/OFS/ObjectManager.py 2005-12-05 13:54:19 UTC (rev 40535) +++ Zope/branches/2.9/lib/python/OFS/ObjectManager.py 2005-12-05 15:07:46 UTC (rev 40536) @@ -273,6 +273,20 @@ raise AttributeError, id return default +def hasObject(self, id): +Indicate whether the folder has an item by ID. + +This doesn't try to be more intelligent than _getOb, and doesn't +consult _objects (for performance reasons). The common use case +is to check that an object does *not* exist. + +if (id in ('.', '..') or +id.startswith('_') or +id.startswith('aq_') or +id.endswith('__')): +return False +return getattr(aq_base(self), id, None) is not None + def _setObject(self, id, object, roles=None, user=None, set_owner=1, suppress_events=False): Set an object into this container. Modified: Zope/branches/2.9/lib/python/OFS/interfaces.py === --- Zope/branches/2.9/lib/python/OFS/interfaces.py 2005-12-05 13:54:19 UTC (rev 40535) +++ Zope/branches/2.9/lib/python/OFS/interfaces.py 2005-12-05 15:07:46 UTC (rev 40536) @@ -531,6 +531,10 @@ +def hasObject(id): +Indicate whether the folder has an item by ID. + + def objectIds(spec=None): List the IDs of the subobjects of the current object. Modified: Zope/branches/2.9/lib/python/OFS/tests/testObjectManager.py === --- Zope/branches/2.9/lib/python/OFS/tests/testObjectManager.py 2005-12-05 13:54:19 UTC (rev 40535) +++ Zope/branches/2.9/lib/python/OFS/tests/testObjectManager.py 2005-12-05 15:07:46 UTC (rev 40536) @@ -328,6 +328,22 @@ om2._setObject(ob.getId(), ob) self.assertRaises(DeleteFailed, om1._delObject, 'om2') +def test_hasObject(self): +om = self._makeOne() +self.failIf(om.hasObject('_properties')) +self.failIf(om.hasObject('_getOb')) +self.failIf(om.hasObject('__of__')) +self.failIf(om.hasObject('.')) +self.failIf(om.hasObject('..')) +self.failIf(om.hasObject('aq_base')) +om.zap__ = True +self.failIf(om.hasObject('zap__')) +self.failIf(om.hasObject('foo')) +si = SimpleItem('foo') +om._setObject('foo', si) +self.assert_(om.hasObject('foo')) +om._delObject('foo') +self.failIf(om.hasObject('foo')) def test_setObject_checkId_ok(self): om = self._makeOne() ___ Zope-Checkins maillist - Zope-Checkins@zope.org http://mail.zope.org/mailman/listinfo/zope-checkins
[Zope-Checkins] SVN: Zope/trunk/ Merged r40536 from 2.9 branch:
Log message for revision 40537: Merged r40536 from 2.9 branch: ObjectManager now has an hasObject method to test presence. This brings it in line with BTreeFolder. Changed: U Zope/trunk/doc/CHANGES.txt U Zope/trunk/lib/python/OFS/ObjectManager.py U Zope/trunk/lib/python/OFS/interfaces.py U Zope/trunk/lib/python/OFS/tests/testObjectManager.py -=- Modified: Zope/trunk/doc/CHANGES.txt === --- Zope/trunk/doc/CHANGES.txt 2005-12-05 15:07:46 UTC (rev 40536) +++ Zope/trunk/doc/CHANGES.txt 2005-12-05 15:12:52 UTC (rev 40537) @@ -26,6 +26,9 @@ Features added + - ObjectManager now has an hasObject method to test presence. This +brings it in line with BTreeFolder. + - Using FastCGI is offically deprecated. - Improved logging of ConflictErrors. All conflict errors are Modified: Zope/trunk/lib/python/OFS/ObjectManager.py === --- Zope/trunk/lib/python/OFS/ObjectManager.py 2005-12-05 15:07:46 UTC (rev 40536) +++ Zope/trunk/lib/python/OFS/ObjectManager.py 2005-12-05 15:12:52 UTC (rev 40537) @@ -272,6 +272,20 @@ raise AttributeError, id return default +def hasObject(self, id): +Indicate whether the folder has an item by ID. + +This doesn't try to be more intelligent than _getOb, and doesn't +consult _objects (for performance reasons). The common use case +is to check that an object does *not* exist. + +if (id in ('.', '..') or +id.startswith('_') or +id.startswith('aq_') or +id.endswith('__')): +return False +return getattr(aq_base(self), id, None) is not None + def _setObject(self, id, object, roles=None, user=None, set_owner=1, suppress_events=False): Set an object into this container. Modified: Zope/trunk/lib/python/OFS/interfaces.py === --- Zope/trunk/lib/python/OFS/interfaces.py 2005-12-05 15:07:46 UTC (rev 40536) +++ Zope/trunk/lib/python/OFS/interfaces.py 2005-12-05 15:12:52 UTC (rev 40537) @@ -531,6 +531,10 @@ +def hasObject(id): +Indicate whether the folder has an item by ID. + + def objectIds(spec=None): List the IDs of the subobjects of the current object. Modified: Zope/trunk/lib/python/OFS/tests/testObjectManager.py === --- Zope/trunk/lib/python/OFS/tests/testObjectManager.py2005-12-05 15:07:46 UTC (rev 40536) +++ Zope/trunk/lib/python/OFS/tests/testObjectManager.py2005-12-05 15:12:52 UTC (rev 40537) @@ -328,6 +328,22 @@ om2._setObject(ob.getId(), ob) self.assertRaises(DeleteFailed, om1._delObject, 'om2') +def test_hasObject(self): +om = self._makeOne() +self.failIf(om.hasObject('_properties')) +self.failIf(om.hasObject('_getOb')) +self.failIf(om.hasObject('__of__')) +self.failIf(om.hasObject('.')) +self.failIf(om.hasObject('..')) +self.failIf(om.hasObject('aq_base')) +om.zap__ = True +self.failIf(om.hasObject('zap__')) +self.failIf(om.hasObject('foo')) +si = SimpleItem('foo') +om._setObject('foo', si) +self.assert_(om.hasObject('foo')) +om._delObject('foo') +self.failIf(om.hasObject('foo')) def test_setObject_checkId_ok(self): om = self._makeOne() ___ Zope-Checkins maillist - Zope-Checkins@zope.org http://mail.zope.org/mailman/listinfo/zope-checkins
[Zope-Checkins] SVN: Zope/branches/Zope-2_8-branch/ Merged r40536 from 2.9 branch:
Log message for revision 40542: Merged r40536 from 2.9 branch: ObjectManager now has an hasObject method to test presence. This brings it in line with BTreeFolder. Changed: U Zope/branches/Zope-2_8-branch/doc/CHANGES.txt U Zope/branches/Zope-2_8-branch/lib/python/OFS/ObjectManager.py U Zope/branches/Zope-2_8-branch/lib/python/OFS/tests/testObjectManager.py -=- Modified: Zope/branches/Zope-2_8-branch/doc/CHANGES.txt === --- Zope/branches/Zope-2_8-branch/doc/CHANGES.txt 2005-12-05 15:15:05 UTC (rev 40541) +++ Zope/branches/Zope-2_8-branch/doc/CHANGES.txt 2005-12-05 15:23:20 UTC (rev 40542) @@ -58,6 +58,9 @@ Other + - ObjectManager now has an hasObject method to test presence. This +brings it in line with BTreeFolder. + - Made 'zopectl test' work for software homes which do not have an inplace build (it used to require that test.py be in $ZOPE_HOME/bin/; now it will use $ZOPE_HOME as a fallback). Modified: Zope/branches/Zope-2_8-branch/lib/python/OFS/ObjectManager.py === --- Zope/branches/Zope-2_8-branch/lib/python/OFS/ObjectManager.py 2005-12-05 15:15:05 UTC (rev 40541) +++ Zope/branches/Zope-2_8-branch/lib/python/OFS/ObjectManager.py 2005-12-05 15:23:20 UTC (rev 40542) @@ -261,6 +261,20 @@ raise AttributeError, id return default +def hasObject(self, id): +Indicate whether the folder has an item by ID. + +This doesn't try to be more intelligent than _getOb, and doesn't +consult _objects (for performance reasons). The common use case +is to check that an object does *not* exist. + +if (id in ('.', '..') or +id.startswith('_') or +id.startswith('aq_') or +id.endswith('__')): +return False +return getattr(aq_base(self), id, None) is not None + def _setObject(self, id, object, roles=None, user=None, set_owner=1): v=self._checkId(id) if v is not None: id=v Modified: Zope/branches/Zope-2_8-branch/lib/python/OFS/tests/testObjectManager.py === --- Zope/branches/Zope-2_8-branch/lib/python/OFS/tests/testObjectManager.py 2005-12-05 15:15:05 UTC (rev 40541) +++ Zope/branches/Zope-2_8-branch/lib/python/OFS/tests/testObjectManager.py 2005-12-05 15:23:20 UTC (rev 40542) @@ -303,6 +303,23 @@ om2._setObject(ob.getId(), ob) self.assertRaises(DeleteFailed, om1._delObject, 'om2') +def test_hasObject(self): +om = self._makeOne() +self.failIf(om.hasObject('_properties')) +self.failIf(om.hasObject('_getOb')) +self.failIf(om.hasObject('__of__')) +self.failIf(om.hasObject('.')) +self.failIf(om.hasObject('..')) +self.failIf(om.hasObject('aq_base')) +om.zap__ = True +self.failIf(om.hasObject('zap__')) +self.failIf(om.hasObject('foo')) +si = SimpleItem('foo') +om._setObject('foo', si) +self.assert_(om.hasObject('foo')) +om._delObject('foo') +self.failIf(om.hasObject('foo')) + def test_setObject_checkId_ok(self): om = self._makeOne() si = SimpleItem('1') ___ Zope-Checkins maillist - Zope-Checkins@zope.org http://mail.zope.org/mailman/listinfo/zope-checkins
[Zope-Checkins] SVN: Zope/branches/Zope-2_8-branch/ - reverted workaround in '_verifyObjectPaste'; 'checkPermission' now respects proxy roles
Log message for revision 40550: - reverted workaround in '_verifyObjectPaste'; 'checkPermission' now respects proxy roles Changed: U Zope/branches/Zope-2_8-branch/doc/CHANGES.txt U Zope/branches/Zope-2_8-branch/lib/python/OFS/CopySupport.py U Zope/branches/Zope-2_8-branch/lib/python/OFS/tests/testCopySupport.py -=- Modified: Zope/branches/Zope-2_8-branch/doc/CHANGES.txt === --- Zope/branches/Zope-2_8-branch/doc/CHANGES.txt 2005-12-05 17:13:57 UTC (rev 40549) +++ Zope/branches/Zope-2_8-branch/doc/CHANGES.txt 2005-12-05 18:26:15 UTC (rev 40550) @@ -26,6 +26,11 @@ Bugs Fixed + - CopySupport: Reverted workaround in '_verifyObjectPaste'. +'checkPermission' now respects proxy roles, so the warkaround +introduced to fix http://www.zope.org/Collectors/Zope/78 is no longer +needed. Meta types listed in all_meta_types need a 'permission' key. + - Collector #1774: Harmonize the implementation of AccessControl.ZopeSecurityPolicy.checkPermission with 'validate', checking ownership and proxy roles if an Modified: Zope/branches/Zope-2_8-branch/lib/python/OFS/CopySupport.py === --- Zope/branches/Zope-2_8-branch/lib/python/OFS/CopySupport.py 2005-12-05 17:13:57 UTC (rev 40549) +++ Zope/branches/Zope-2_8-branch/lib/python/OFS/CopySupport.py 2005-12-05 18:26:15 UTC (rev 40550) @@ -19,6 +19,7 @@ from cgi import escape from marshal import loads, dumps from urllib import quote, unquote +from warnings import warn from zlib import compress, decompress import Globals, Moniker, ExtensionClass @@ -352,7 +353,7 @@ if not hasattr(object, 'meta_type'): raise CopyError, MessageDialog( title = 'Not Supported', - message = ('The object EM%s/EM does not support this' \ + message = ('The object em%s/em does not support this' \ ' operation' % escape(absattr(object.id))), action = 'manage_main') @@ -372,36 +373,50 @@ mt_permission = d.get('permission') break -if method_name: -try: -method = self.restrictedTraverse(method_name) -# method_name is e.g. -# manage_addProduct/PageTemplates/manage_addPageTemplateForm. -# restrictedTraverse will raise Unauthorized if it -# can't obtain the factory method by name due to a -# security restriction. We depend on this side effect -# here! Note that we use restrictedTraverse as -# opposed to checkPermission to take into account the -# special security circumstances related to proxy -# roles. See collector #78. +if mt_permission is not None: +sm = getSecurityManager() -except Unauthorized: -if mt_permission: +if sm.checkPermission(mt_permission, self): +if validate_src: +# Ensure the user is allowed to access the object on the +# clipboard. +try: +parent = aq_parent(aq_inner(object)) +except: +parent = None + +if not sm.validate(None, parent, None, object): +raise Unauthorized(absattr(object.id)) + +if validate_src == 2: # moving +if not sm.checkPermission(DeleteObjects, parent): +raise Unauthorized('Delete not allowed.') +else: +raise CopyError, MessageDialog( +title = 'Insufficient Privileges', message = ('You do not possess the %s permission in the ' 'context of the container into which you are ' 'pasting, thus you are not able to perform ' - 'this operation.' % mt_permission) -else: + 'this operation.' % mt_permission), +action = 'manage_main') +elif method_name: +# BBB: fallback for missing or None permission +warn(The required 'permission' key is not set or None for meta + type '%s'. This fallback will be removed in Zope 2.9. + % object.meta_type, + DeprecationWarning) +try: +method = self.restrictedTraverse(method_name) +except Unauthorized: +raise CopyError, MessageDialog( +title = 'Insufficient Privileges', message = ('You do not possess the permission required ' 'to call %s in the
[Zope-Checkins] SVN: Zope/trunk/lib/python/OFS/ - reverted workaround in '_verifyObjectPaste'; 'checkPermission' now respects proxy roles
Log message for revision 40552: - reverted workaround in '_verifyObjectPaste'; 'checkPermission' now respects proxy roles Changed: U Zope/trunk/lib/python/OFS/CopySupport.py U Zope/trunk/lib/python/OFS/tests/testCopySupport.py -=- Modified: Zope/trunk/lib/python/OFS/CopySupport.py === --- Zope/trunk/lib/python/OFS/CopySupport.py2005-12-05 18:26:31 UTC (rev 40551) +++ Zope/trunk/lib/python/OFS/CopySupport.py2005-12-05 18:26:49 UTC (rev 40552) @@ -477,7 +477,7 @@ if not hasattr(object, 'meta_type'): raise CopyError, MessageDialog( title = 'Not Supported', - message = ('The object EM%s/EM does not support this' \ + message = ('The object em%s/em does not support this' \ ' operation' % escape(absattr(object.id))), action = 'manage_main') @@ -497,60 +497,38 @@ mt_permission = d.get('permission') break -if method_name: -try: -method = self.restrictedTraverse(method_name) -# method_name is e.g. -# manage_addProduct/PageTemplates/manage_addPageTemplateForm. -# restrictedTraverse will raise Unauthorized if it -# can't obtain the factory method by name due to a -# security restriction. We depend on this side effect -# here! Note that we use restrictedTraverse as -# opposed to checkPermission to take into account the -# special security circumstances related to proxy -# roles. See collector #78. +if mt_permission is not None: +sm = getSecurityManager() -except Unauthorized: -if mt_permission: +if sm.checkPermission(mt_permission, self): +if validate_src: +# Ensure the user is allowed to access the object on the +# clipboard. +try: +parent = aq_parent(aq_inner(object)) +except: +parent = None + +if not sm.validate(None, parent, None, object): +raise Unauthorized(absattr(object.id)) + +if validate_src == 2: # moving +if not sm.checkPermission(delete_objects, parent): +raise Unauthorized('Delete not allowed.') +else: +raise CopyError, MessageDialog( +title = 'Insufficient Privileges', message = ('You do not possess the %s permission in the ' 'context of the container into which you are ' 'pasting, thus you are not able to perform ' - 'this operation.' % mt_permission) -else: -message = ('You do not possess the permission required ' - 'to call %s in the context of the container ' - 'into which you are pasting, thus you are not ' - 'able to perform this operation.' % method_name) - -raise CopyError, MessageDialog( - title = 'Insufficient Privileges', - message = message, - action = 'manage_main') - -if validate_src: - -sm = getSecurityManager() - -# Ensure the user is allowed to access the object on the -# clipboard. -try: -parent = aq_parent(aq_inner(object)) -except: -parent = None - -if not sm.validate(None,parent,None,object): -raise Unauthorized, absattr(object.id) - -if validate_src == 2: # moving -if not sm.checkPermission(delete_objects, parent): -raise Unauthorized, 'Delete not allowed.' - -else: # /if method_name + 'this operation.' % mt_permission), +action = 'manage_main') +else: raise CopyError, MessageDialog( - title = 'Not Supported', - message = ('The object EM%s/EM does not support this ' - 'operation.' % escape(absattr(object.id))), - action = 'manage_main') +title = 'Not Supported', +message = ('The object em%s/em does not support this ' + 'operation.' % escape(absattr(object.id))), +action = 'manage_main') InitializeClass(CopyContainer) Modified: Zope/trunk/lib/python/OFS/tests/testCopySupport.py
[Zope-Checkins] SVN: Zope/tags/2.9.0b1/ Zope 2.9.0 beta 1
Log message for revision 40578: Zope 2.9.0 beta 1 Changed: A Zope/tags/2.9.0b1/ -=- Copied: Zope/tags/2.9.0b1 (from rev 40577, Zope/branches/2.9) ___ Zope-Checkins maillist - Zope-Checkins@zope.org http://mail.zope.org/mailman/listinfo/zope-checkins
[Zope-Checkins] SVN: Zope/branches/2.9/doc/CHANGES.txt typo
Log message for revision 40579: typo Changed: U Zope/branches/2.9/doc/CHANGES.txt -=- Modified: Zope/branches/2.9/doc/CHANGES.txt === --- Zope/branches/2.9/doc/CHANGES.txt 2005-12-06 06:43:47 UTC (rev 40578) +++ Zope/branches/2.9/doc/CHANGES.txt 2005-12-06 06:44:09 UTC (rev 40579) @@ -22,7 +22,7 @@ - Collector #1233: port ZOPE_CONFIG patch from Zope 2.7 to Zope 2.8 - Zope 2.9.1 beta 1 (2005/12/06) + Zope 2.9.0 beta 1 (2005/12/06) Features added ___ Zope-Checkins maillist - Zope-Checkins@zope.org http://mail.zope.org/mailman/listinfo/zope-checkins
[Zope-Checkins] SVN: Zope/tags/2.9.0b1/2.9/ Zope 2.9.0 b1
Log message for revision 40580: Zope 2.9.0 b1 Changed: A Zope/tags/2.9.0b1/2.9/ -=- Copied: Zope/tags/2.9.0b1/2.9 (from rev 40579, Zope/branches/2.9) ___ Zope-Checkins maillist - Zope-Checkins@zope.org http://mail.zope.org/mailman/listinfo/zope-checkins
[Zope-dev] zLOG deprecation?
Hi All, Is zLOG deprecated? If not, it should be... Chris -- Simplistix - Content Management, Zope Python Consulting - http://www.simplistix.co.uk ___ Zope-Dev maillist - Zope-Dev@zope.org http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] Logging of ConflictError
Dennis Allison wrote: Dieter's point about not includeing the traceback makes sense if all it does is report on the reporting code. Yeah, the traceback just shows where the ConflictError was raised, not what caused it, and theyr'e always in very different places... Wlorent, do you envision a single ConflicError or two -- one which succeeds on retry and another where the retry fails? Huh? ConflictErrors are ConflictErrors, it's a server level decision as to how they're handled. Zope chooses to retry the whole request up to 3 times when a ConflictError occurs. The new logging code I put in records exactly how many conflicts have occurrred, and how many remain unresolved even after 3 retries. I know you've been having fun with this type of error, so you might well want to grav the changes from svn and give them a spin... cheers, Chris -- Simplistix - Content Management, Zope Python Consulting - http://www.simplistix.co.uk ___ Zope-Dev maillist - Zope-Dev@zope.org http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] Please vote about conflict errors logging
Jean-Marc Orliaguet wrote: In my case it's mostly filesystem-based resources (css files, or images) accessed in read mode (zope-2.8.4). But the information no matter where it comes from has very little value compared to other messages in the log file, because these are completely predictable. That's your judgement. Many of us feel differently. In the log flle I'd like to be informed about events that are unexpected. Conflict errors of this kind occur by design. ...well, by the design of your app, yes. If you're getting more than a few, you really need to reconsider your design. cheers, Chris -- Simplistix - Content Management, Zope Python Consulting - http://www.simplistix.co.uk ___ Zope-Dev maillist - Zope-Dev@zope.org http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] Time for a beta!
--On 4. Dezember 2005 20:55:48 +0100 Andreas Jung [EMAIL PROTECTED] wrote: --On 4. Dezember 2005 14:36:17 -0500 Jim Fulton [EMAIL PROTECTED] wrote: Zope 3 seems to ve ready for a beta release. Does that mean Zope 2 is ready? Zope 2 should be ready. However there seems to be an unresolved issue with building the distribution archive from the sources (something for Philipp?). This issue is now resolved (local problem on my side). So I am ready to cut a b1 release. Andreas pgpRfoL8KXQ3H.pgp Description: PGP signature ___ Zope-Dev maillist - Zope-Dev@zope.org http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
[Zope-dev] Re: zLOG deprecation?
Chris Withers wrote: Is zLOG deprecated? If not, it should be... +10 zLOG/__init__.py says: Note: This module exists only for backward compatibility. Any new code for Zope 2.8 and newer should use the logging module from Python's standard library directly. zLOG is only an API shim to map existing use of zLOG onto the standard logging API. That means we could deprecate it even in Zope 2.9, using zLOG has already been discouraged in Zope 2.8. I'm not sure if the differences in logging levels will be important to backward compatability. ZODB/loglevels.py explains the differences:: # In the days of zLOG, there were 7 standard log levels, and ZODB/ZEO used # all of them. Here's how they map to the logging package's 5 standard # levels: # #zLOG logging #---- #PANIC (300) FATAL, CRITICAL (50) #ERROR (200) ERROR (40) #WARNING, PROBLEM (100) WARN (30) #INFO (0) INFO (20) #BLATHER (-100) none -- defined here as BLATHER (15) #DEBUG (-200) DEBUG (10) #TRACE (-300) none -- defined here as TRACE (5) # # TRACE is used by ZEO for extremely verbose trace output, enabled only # when chasing bottom-level communications bugs. It really should be at # a lower level than DEBUG. # # BLATHER is a harder call, and various instances could probably be folded # into INFO or DEBUG without real harm. Philipp ___ Zope-Dev maillist - Zope-Dev@zope.org http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
[Zope-dev] Zope 2.9 b1 coming
Just to let you know: Zope 2.9 b1 will be released together with Zope 3.2 b1 this Wednesday..so the last changes and fixes should be done until Wednesday morning. Thanks, Andreas pgpnUD4IB53W0.pgp Description: PGP signature ___ Zope-Dev maillist - Zope-Dev@zope.org http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] Zope 2.9 b1 coming
Andreas Jung wrote: Just to let you know: Zope 2.9 b1 will be released together with Zope 3.2 b1 this Wednesday..so the last changes and fixes should be done until Wednesday morning. I'm going to try to get a 3.2 beta out today. Jim -- Jim Fulton mailto:[EMAIL PROTECTED] Python Powered! CTO (540) 361-1714http://www.python.org Zope Corporation http://www.zope.com http://www.zope.org ___ Zope-Dev maillist - Zope-Dev@zope.org http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] Zope 2.9 b1 coming
--On 5. Dezember 2005 16:10:11 +0100 Andreas Jung [EMAIL PROTECTED] wrote: Just to let you know: Zope 2.9 b1 will be released together with Zope 3.2 b1 this Wednesday..so the last changes and fixes should be done until Wednesday morning. We will release 2.9 earlier. Jim is going to release 3.2 hopefully tonight and I will follow with the 2.9 b1 release tomorrow morning. Andrea pgpf1YB80YVrf.pgp Description: PGP signature ___ Zope-Dev maillist - Zope-Dev@zope.org http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
[Zope-dev] ObjectManager.hasObject
I've added a long needed hasObject method to ObjectManager. Note that BTreeFolder2 has had it for a long time and it's quite useful. Enjoy. Florent -- Florent Guillaume, Nuxeo (Paris, France) CTO, Director of RD +33 1 40 33 71 59 http://nuxeo.com [EMAIL PROTECTED] ___ Zope-Dev maillist - Zope-Dev@zope.org http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
[Zope-dev] Re: toplevel products folder in zope svn ?
Rocky Burt wrote: Anyone know if there is any plan to add a toplevel products folder in the zope svn repo like there currently is in zope's cvs repo? I know this has held up a few products from going from zope CVS to SVN. I don't think a separate Products folder is is necessary. Just make top-level projects in SVN, like /Products.Basket/trunk/Basket This would follow the pattern of other top-level projects whose project names are their dotted name, like zope.testing. Philipp ___ Zope-Dev maillist - Zope-Dev@zope.org http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] Please vote about conflict errors logging
On Fri, 2005-12-02 at 23:00 +0100, Florent Guillaume wrote: 1. Do you want these ConflictErrors retried logs to be at level: - INFO INFO - BLATHER - DEBUG - not logged - other 2. In addition, please specify if you feel those retried ConflictErrors should have their full traceback logged? - Yes, with traceback - No, without traceback No Traceback 3. Finally, please tell us if the ConflictErrors that *can't* be retried (and are returned to the user as an error, and are also logged to the error_log) should be additionally explicitely logged to the event log, and at which level: - ERROR - not logged - other Error (Also, if you feel the logging should be different between 2.8 and 2.9, please say so.) I'll wait until Wednesday morning to collect results. Thanks, Florent Andrew ___ Zope-Dev maillist - Zope-Dev@zope.org http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
[Zope-dev] Re: zLOG deprecation?
Philipp von Weitershausen wrote: If not, it should be... +10 Yeah, me too! Hence why I was asking ;-) That means we could deprecate it even in Zope 2.9, using zLOG has already been discouraged in Zope 2.8. Cool, Andreas, can you make it start emitting deprecation warnings? (if you do, lemme know and I'll go grep the Zope 2 source and try and eradicate any remaining zLOG) I'm not sure if the differences in logging levels will be important to backward compatability. I _know_ they won't ;-) ZODB/loglevels.py explains the differences:: # In the days of zLOG, there were 7 standard log levels, and ZODB/ZEO used # all of them. Here's how they map to the logging package's 5 standard # levels: # #zLOG logging #---- #PANIC (300) FATAL, CRITICAL (50) #ERROR (200) ERROR (40) #WARNING, PROBLEM (100) WARN (30) #INFO (0) INFO (20) #BLATHER (-100) none -- defined here as BLATHER (15) #DEBUG (-200) DEBUG (10) imnsho, blather and debug are the wrong way round. blather should go away completely, it's a stupid name anyway :-( cheers, Chris -- Simplistix - Content Management, Zope Python Consulting - http://www.simplistix.co.uk ___ Zope-Dev maillist - Zope-Dev@zope.org http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
[Zope-dev] Re: zLOG deprecation?
Chris Withers wrote: # In the days of zLOG, there were 7 standard log levels, and ZODB/ZEO used # all of them. Here's how they map to the logging package's 5 standard # levels: # #zLOG logging #---- #PANIC (300) FATAL, CRITICAL (50) #ERROR (200) ERROR (40) #WARNING, PROBLEM (100) WARN (30) #INFO (0) INFO (20) #BLATHER (-100) none -- defined here as BLATHER (15) #DEBUG (-200) DEBUG (10) imnsho, blather and debug are the wrong way round. blather should go away completely, it's a stupid name anyway :-( Just because you don't see the use in something doesn't mean it has to go away. In my book BLATHER is used for verbose INFO and is different than DEBUG and TRACE (both levels are useful too). INFO and BLATHER are for the administrator. DEBUG and TRACE are for the developer. Florent -- Florent Guillaume, Nuxeo (Paris, France) CTO, Director of RD +33 1 40 33 71 59 http://nuxeo.com [EMAIL PROTECTED] ___ Zope-Dev maillist - Zope-Dev@zope.org http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] Re: zLOG deprecation?
We probably want an ALL level as well which would map to the NOTSET of the Python logging code and log everything. Florent, I don't see a TRACE level in this list. Did you think one was needed? On Mon, 5 Dec 2005, Florent Guillaume wrote: Chris Withers wrote: # In the days of zLOG, there were 7 standard log levels, and ZODB/ZEO used # all of them. Here's how they map to the logging package's 5 standard # levels: # #zLOG logging #---- #PANIC (300) FATAL, CRITICAL (50) #ERROR (200) ERROR (40) #WARNING, PROBLEM (100) WARN (30) #INFO (0) INFO (20) #BLATHER (-100) none -- defined here as BLATHER (15) #DEBUG (-200) DEBUG (10) imnsho, blather and debug are the wrong way round. blather should go away completely, it's a stupid name anyway :-( Just because you don't see the use in something doesn't mean it has to go away. In my book BLATHER is used for verbose INFO and is different than DEBUG and TRACE (both levels are useful too). INFO and BLATHER are for the administrator. DEBUG and TRACE are for the developer. Florent -- ___ Zope-Dev maillist - Zope-Dev@zope.org http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] Re: zLOG deprecation?
[Dennis Allison] We probably want an ALL level as well which would map to the NOTSET of the Python logging code and log everything. Why not call it NOTSET? Then you already have it ;-) Or forget it -- TRACE gets everything anyway. Florent, I don't see a TRACE level in this list. Did you think one was needed? See Florent's original message; Chris chopped TRACE away in his reply. Also note that the code Florent pointed at is part of ZODB, not part of Zope. Zope shouldn't use it directly. Growing its own copy would be OK, or refactoring so that ZODB and Zope both get it from a shared new mini-project. ___ Zope-Dev maillist - Zope-Dev@zope.org http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] Please vote about conflict errors logging
Florent Guillaume wrote at 2005-12-2 23:00 +0100: Please vote for the level at which you want to log retried conflict errors. These are the ConflictErrors that aren't returned to the user but automatically retried by the Zope publisher. 1. Do you want these ConflictErrors retried logs to be at level: - INFO - BLATHER - DEBUG - not logged - other INFO (i *really* want to know, if there are lots of conflict errors) 2. In addition, please specify if you feel those retried ConflictErrors should have their full traceback logged? - Yes, with traceback - No, without traceback No traceback (as Dieter has pointed out, they contain no useful information) 3. Finally, please tell us if the ConflictErrors that *can't* be retried (and are returned to the user as an error, and are also logged to the error_log) should be additionally explicitely logged to the event log, and at which level: - ERROR - not logged - other Like any other exception seen by the user Thanks! \wlang{} -- [EMAIL PROTECTED]Fax: +43/1/31336/9207 Zentrum fuer Informatikdienste, Wirtschaftsuniversitaet Wien, Austria ___ Zope-Dev maillist - Zope-Dev@zope.org http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
[Zope-dev] Re: AcceleratedHTTPCache and virtual hosting (collector 1447)
On Sat, Dec 03, 2005 at 11:29:48AM -0500, Tres Seaver wrote: Paul Winkler wrote: (snip) ... AcceleratedHTTPCacheManager has no test suite at all. Erm. Actually it does; Tres added it on the TRUNK many months ago. I was looking at a 2.7 checkout! Mea culpa. However, the test suite currently *does* fire up an HTTP server (on a hardwired port, 1888). As I said, I'm not crazy about this, it seems needlessly fragile and makes the test code harder to read than I'd like. So I'm inclined to follow Tres' adapter suggestion, it seems like The Right Thing to me. I'll modify the existing suite accordingly on a branch. To the other respondents: Thanks for the suggestions, but I do not consider making AcceleratedHTTPCacheManager more flexible to be a test turd. Tres outlined a real use case for changing the code (see below). I don't understand why you guys consider this more invasive than monkeypatching, which is capable of causing obscure breakage in far-flung tests. But thanks anyway. You could modify the testing code do an adapter lookup for a component used to do the HTTP client stuff, and then arrange to register your dummy object in a test. I imagine that this would be useful for more than just testing; for instance, if I want to purge a whole tier of Squids, right now the only way to do that is to write a proxy-proxy (one version I wrote once was called PageAssassin) which distributes the PURGE request to them. An adapter-based scheme would allow me to replace the stock version with one which distributed the PURGE directly. Tres. -- Paul Winkler http://www.slinkp.com ___ Zope-Dev maillist - Zope-Dev@zope.org http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] Please vote about conflict errors logging
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Florent Guillaume wrote: Please vote for the level at which you want to log retried conflict errors. These are the ConflictErrors that aren't returned to the user but automatically retried by the Zope publisher. 1. Do you want these ConflictErrors retried logs to be at level: - INFO - BLATHER - DEBUG - not logged - other BLATHER. 2. In addition, please specify if you feel those retried ConflictErrors should have their full traceback logged? - Yes, with traceback - No, without traceback with traceback because of the BLATHER mode above. 3. Finally, please tell us if the ConflictErrors that *can't* be retried (and are returned to the user as an error, and are also logged to the error_log) should be additionally explicitely logged to the event log, and at which level: - ERROR - not logged - other ERROR (Also, if you feel the logging should be different between 2.8 and 2.9, please say so.) Of course the same... J. - -- Julien Anguenot | Nuxeo RD (Paris, France) CPS Platform : http://www.cps-project.org Zope3 / ECM : http://www.z3lab.org mail: anguenot at nuxeo.com; tel: +33 (0) 6 72 57 57 66 -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.1 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFDlNhcGhoG8MxZ/pIRAsg4AJkBPnW4zGrl4GdZxEXXEZCpwcCdswCfU3hE 41XwD/GgOGRNAEC0nYh7lKM= =qNsx -END PGP SIGNATURE- ___ Zope-Dev maillist - Zope-Dev@zope.org http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
[Zope-dev] Re: zLOG deprecation?
Chris Withers wrote: Philipp von Weitershausen wrote: If not, it should be... +10 Yeah, me too! Hence why I was asking ;-) That means we could deprecate it even in Zope 2.9, using zLOG has already been discouraged in Zope 2.8. Cool, Andreas, can you make it start emitting deprecation warnings? (if you do, lemme know and I'll go grep the Zope 2 source and try and eradicate any remaining zLOG) This would probably best be handled by one person, so if you are willing to do all the grepping and updating, making zLOG deprecated would just be a minor operation :). In zLOG.LOG one would call warnings.warn() and the custom zLOG logging level constants could be wrapped in a deprecation warnings (zope.deprecation.deprecate) telling people where to import the level from now (either logging or ZODB.loglevels). I'm not sure if the differences in logging levels will be important to backward compatability. I _know_ they won't ;-) If you say so :) ZODB/loglevels.py explains the differences:: # In the days of zLOG, there were 7 standard log levels, and ZODB/ZEO used # all of them. Here's how they map to the logging package's 5 standard # levels: # #zLOG logging #---- #PANIC (300) FATAL, CRITICAL (50) #ERROR (200) ERROR (40) #WARNING, PROBLEM (100) WARN (30) #INFO (0) INFO (20) #BLATHER (-100) none -- defined here as BLATHER (15) #DEBUG (-200) DEBUG (10) imnsho, blather and debug are the wrong way round. blather should go away completely, it's a stupid name anyway :-( Well, stupid or not, the order in which BLATHER and DEBUG are should be preserved, even if it might not make sense. Question is if we actually need BLATHER in the future. For all I care we could rip it out. Philipp This message was sent using IMP, the Internet Messaging Program. ___ Zope-Dev maillist - Zope-Dev@zope.org http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
ConflictError's worthwhile to note? (was: Re: [Zope-dev] Please vote about conflict errors logging)
Jean-Marc Orliaguet wrote at 2005-12-4 22:28 +0100: ... In the log flle I'd like to be informed about events that are unexpected. Conflict errors of this kind occur by design. This argument is not convincing: In a similar way, I could argue that MemoryErrors are there by design. While it is true that *occational* ConflictErrors are nothing to worry about, a higher rate indicates that you soon may come into trouble -- because the risk increases that the automatic retries will not be able to recover and your users will see errors. Obviously, a ConflictError is far less important than a MemoryError, but a higher rate of conflicts should be analysed and if possible avoided. The conflict rate is related to the quality of your application design. I like quality related information in my logfiles -- to be able to take action before it is too late. -- Dieter ___ Zope-Dev maillist - Zope-Dev@zope.org http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] Ignoring Warnings
Chris Withers wrote at 2005-12-5 07:37 +: Great, so rather than fix the warnings, we add code to ignore them... Usage: ./bin/zopectl test --keepbytecode --nowarnings --dir Products/CMFPlone A colleague of mine will be very happy: The hundreds of (mostly stupid deprecation) warnings prevent him to efficiently find the true problems in the test runner reports. In principle, he could fix the warnings -- but they (mostly) come not from our code but third party one. And, if possible, he would perfer not to such third party code... -- Dieter ___ Zope-Dev maillist - Zope-Dev@zope.org http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
[Zope-dev] version.txt [was: make sdist]
Andreas Jung wrote: make sdist: [EMAIL PROTECTED]:~/sandboxes/Zope-2.9/2.9.0b1: make sdist zpkg -C /develop/sandboxes/Zope-2.9/2.9.0b1/releases/Zope2.cfg 'version.txt' doesn't match any files in collection (in /develop/sandboxes/Zope-2.9/2.9.0b1/lib/python/zope/app/PACKAGE.cfg) temporary files are in /tmp/zpkg-50vtPj make: *** [sdist] Error 1 This is a very recent problem and a result of Jim's inconsistent handling of the version.txt matter yesterday. http://dev.zope.org/Zope3/MakingARelease says that zope.app/version.txt should be created on a tag and zope.app/PACKAGE.cfg should also be modified to include version.txt *on the tag*. Jim did the latter on the Zope 3.2 branch. The Zope 2.9 externals currently point to the Zope 3.2 branch which references version.txt in PACKAGE.cfg but doesn't have one. Only the 3.2.0beta1 tag has it. I think that a) zope.app/PACKAGE.cfg should not mention version.txt when there isn't one, meaning on the branch b) Zope 2.9 externals should now point to the Zope 3.2.0beta1 tag. By the way, this issue reminds me: We haven't figured out how to handle Zope 2's version.txt at all! I totally forgot about it. Zope 2 expects a version.txt in Zope/lib/python, but zpkg has no way to support a data file that isn't in a Python package. So there would be no way to package it nor to install it (I don't think distutils knows how to install a non-package-related datafile either). I propose that the future place for Zope 2's version.txt is the Zope2 package. Some code inside Zope 2 that reads version info from version.txt would have to be changed for that, though. This should be fixed for the 2.9 beta, meaning today. I'm outside svn+ssh access range right now, so either you do it, Andreas, or you wait until I'm at home in about 5 hours. Philipp This message was sent using IMP, the Internet Messaging Program. ___ Zope-Dev maillist - Zope-Dev@zope.org http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
Re: [Zope-DB] Z SQL equivelant of MySQL's SQL_CALC_FOUND_ROWS?
Charlie Clark wrote: SELECT count(attribute) FROM relatiin WHERE condition Ah, okay, now I gotcha... only returns 1 result so it's independent of LIMIT and result sets. I wonder how the two methods compare efficiency-wise? Yes, well, we're talking about MySQL specifically ;-) Maybe although I sometimes why MySQL does anything: the documentation seems to imply that many decisions were sort of let's do it like this: cf. particularly the recommendations for writing queries with JOINs. Personally I do not see it as valid SQL to predicate a query on what was just asked. Sorry, not a lot of this paragraph made sense :-S Regarding the original question: if I know I am working with LIMITs or result sets then this implies I don't want to know the total size of the results beyound len(results). Not so. Think of batches: Now showing Results 5 - 10 of 25 But why not just return all the rows and only show 5 of them? Now showing Results 5 - 10 of 25 ;-) Yes, it'll likely be a slower query anyway, but I can assure you, Zope turning each of those rows into a Result object will be a LOT slower... cheers, Chris -- Simplistix - Content Management, Zope Python Consulting - http://www.simplistix.co.uk ___ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db
Re: [Zope-DB] Z SQL equivelant of MySQL's SQL_CALC_FOUND_ROWS?
On 2005-12-05 at 08:42:09 [+0100], Chris Withers [EMAIL PROTECTED] wrote: Charlie Clark wrote: SELECT count(attribute) FROM relatiin WHERE condition Ah, okay, now I gotcha... only returns 1 result so it's independent of LIMIT and result sets. I wonder how the two methods compare efficiency-wise? Yes, well, we're talking about MySQL specifically ;-) Well, with reference to Zope we shouldn't be... Maybe although I sometimes why MySQL does anything: the documentation seems to imply that many decisions were sort of let's do it like this: cf. particularly the recommendations for writing queries with JOINs. Personally I do not see it as valid SQL to predicate a query on what was just asked. Sorry, not a lot of this paragraph made sense :-S It still does to me. Have you had your morning tea? It's not that important. Regarding the original question: if I know I am working with LIMITs or result sets then this implies I don't want to know the total size of the results beyound len(results). Not so. Think of batches: Now showing Results 5 - 10 of 25 But why not just return all the rows and only show 5 of them? Now showing Results 5 - 10 of 25 Yes, let's talk about batches - ZSQL doesn't implement batching so it collects the whole set of results available so len() is available. I agree that this is likely to be inefficient for large results but it doesn't require any additional calls. Or you do as Dieter suggested an run two calls - first one simply counts and the second one effectively does batching. Result sets aren't supported directly so unless the DA provides a method to query on the connection or cursor you will also have to run a separate query with count(). Which means: it would be nice if ZSQL supported batching, preferably by result sets and this means the DAs have to expose more of the underlying functionality and getting more information from the Python driver. Charlie ___ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db