Re: [Zope-dev] ZTables and/or Catalog plugable brains?
Jay, Dylan wrote: (resent to here from [EMAIL PROTECTED] due to complete lack of resoonse. Perhaps there should be three levels of mailing list. zope-use, zope-app-dev, zope-dev or something) I'm in the process of of write a zope product that will deal with a lot numerical data (records with a few ids and a few float values). Rightly or wrongly (comments welcome) I've decided to do this inside the ZODB rather than rely on a relation database. This is largely because this data will - not be high-write - I want to do processing on all this of this data on multiple servers - and I am presuming that at some point in the not too distant future zope will let me replicate this data very easily to make it even more highly available. Write a Python Product. See the Zope Developers Guide for details. http://www.zope.org/Documentation/ZDG/Products.dtml Anyone with comments about how ZPatterns fits into all of this would also be welcome. I can't see that it would particularly help you. -- Steve Alexander Software Engineer Cat-Box limited ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] ZTables and/or Catalog plugable brains?
Jay, Dylan wrote: [snip] Also in my searches I came across lots of references to something called ZTables. This seems to be a Catalog with a UI that is about lots of tabular information (rather than a ZCatalog which is specialized to replicating and indexing existing objects). Is this dead? I got the impression that it is. It's probably not been updated for a long time; I think not even to Zope 2, but I may be mistaken. If not where is it? It was never released as open source, so it isn't floating around except probably at Zope Corporation somewhere. If so, why? It seems like a really good idea to me. It seems to be there are times when objects (esp ZClasses) are too heavy? Obviously ZClasses are heavy, but tabular data in Python goes in some kind of object anyway, so it's rather hard to avoid *objects*, unless you use some external database. MetaKit has a nice Python interface and is lightweight, for instance. I haven't heard of anyone integrating it with Zope yet, though: http://www.equi4.com/metakit Anyway, Python objects are lightweight enough for most purposes. I'm not entirely sure why the idea of ZTables went away so completely. Python tables in the ZODB combined with the catalog should make for an interesting system to play with. Though perhaps there are products out there that actually do this. Come to think of it, MetaPublisher (not to be confused with MetaKit) can use a ZODB backend, can't it? Regards, Martijn ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] ZTables and/or Catalog plugable brains?
I'm not entirely sure why the idea of ZTables went away so completely. Python tables in the ZODB combined with the catalog should make for an interesting system to play with. Though perhaps there are products out there that actually do this. Come to think of it, MetaPublisher (not to be confused with MetaKit) can use a ZODB backend, can't it? Stephan Richter just told me that the ZOQL (short for use SQL-like syntax within the ZODB) has become a reality. Maybe that could be interesting for your problem domain, too. ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] ZTables and/or Catalog plugable brains?
Martijn Faassen wrote: I'm not entirely sure why the idea of ZTables went away so completely. Python tables in the ZODB combined with the catalog should make for an interesting system to play with. Though perhaps there are products out there that actually do this. Come to think of it, MetaPublisher (not to be confused with MetaKit) can use a ZODB backend, can't it? ZTables was a Zope1 product. We never updated it for Zope2. There's so much new machinery in Zope, particularly regarding indexing, that ZTables would really only serve as interesting requirements input. I certainly think that some kind of generic table tool in Zope would be useful. I'm sure that others could do a better job of it than ZTables did, in light of all that's happened in Zope and the CMF since then. In fact, Formulator probably has a role as well. --Paul ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] ZTables and/or Catalog plugable brains?
Stephan Richter just told me that the ZOQL (short for use SQL-like syntax within the ZODB) has become a reality. Maybe that could be interesting for your problem domain, too. I did want to announce it officially yet (and I won't), but the URL is: http://demo.iuveno-net.de/iuveno/Products/ZOQLMethod Regards, Stephan -- Stephan Richter CBU - Physics and Chemistry Student Web2k - Web Design/Development Technical Project Management ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
[Zope-dev] Building a WebDAV capable product: how?
At work, we are seriously considering using Zope. For the Web front-end, we are already sold. However, for our use, we will heavily rely on its WebDAV services. We'll need to do some special tricks, so that legacy systems and Zope interoperate nicely. As a test case, I wanted to see what it takes to create a special product, that appears as a directory in webdav, offering some dummy objects. I want to do this programmatically, not using ZClasses, nor using the Zope management interface. For my test case, I really just want to (ab)use Zope's WebDAV server functionality. Using the A minimal product HOWTO, and inheriting from webdav.Collection a webdav directory appeared quickly. However, I am a bit stuck at figuring out how to get some dummy objects in there. Modifying the self._objects doesn't seem to help, and any documentation on the ObjectManager, and how it relates to FTPList/WebDAV is rather sparse. What I have so far is appended below. Thanks for any Zenlightenment! --8--8--8--8--8--8--8--8 from OFS import * import webdav import OFS from OFS import FTPInterface class duologix( webdav.Collection.Collection, SimpleItem.Item, ObjectManager.ObjectManager, FTPInterface.FTPInterface ): duologix object meta_type = 'duologix' isPrincipiaFolderish=1 def __init__(self, id): initialise a new instance of Duologix self.id = id def index_html(self): used to view content of the object return 'htmlbodyHello World/body/html' def manage_addDuologix(self, RESPONSE): Add a Duologix to a folder. self._setObject('duologix_id', duologix('duologix_id')) RESPONSE.redirect('index_html') ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] ZTables and/or Catalog plugable brains?
On Thursday 04 October 2001 07:34 pm, Jay, Dylan allegedly wrote: I tried using ZClasses but it seems to run slow and take up space. Instead I'm using Catalog (without ZCatalog) to contain the data. I'm presuming this will be quite efficient (comments welcome). Yup that should be pretty efficient. Plus you can index and query the thing fairly easily. Now to my question, How do Catalog plugable brains work? I've looked but can't see what the brain class has to look like to work. My first attempts don't seem to work. The classes are created but don't contain the data. Is the record data passed into the constructor? I'm not an expert on brains per se, but my understanding is that they allow you to wrap functionality from a particular class around data stored in a table (such as a Catalog or an external database) without making each record an instance of the class. This is how, when the Catalog returns data, you get the getURL and getObject methods for each record (among others). TinyTable and Z SQL Methods also support this functionality, and it is exposed in the management interface. This would allow you to store the actual data as regular metadata elements in the Catalog, and get objects out when you query it. It would avoid storing the data twice, once in the objects and again in the metadata and all of the disadvantages this causes in terms of storage and synchronization. Also in my searches I came across lots of references to something called ZTables. This seems to be a Catalog with a UI that is about lots of tabular information (rather than a ZCatalog which is specialized to replicating and indexing existing objects). Is this dead? If not where is it? If so, why? AFAIK, Catalog contains the only remaining remnants of ZTables in Zope. It seems like a really good idea to me. It seems to be there are times when objects (esp ZClasses) are too heavy? ZClasses impose a performance penalty due to their inherent complexity and overhead. You would do much better creating a straight Python class for applications where performance and overhead per record is an issue. I personally avoid using ZClasses for everything but the simplest custom objects. Anyone with comments about how ZPatterns fits into all of this would also be welcome. My understanding is that ZPatterns is for abstracting the application from the storage. It is most beneficial for creating storage-independent applications. It would benefit you if that is a requirement, no so much if not. An example might be an application with data in objects, catalogs and external databases. ZPatterns would let you create an abstraction layer so that the application would not need to be aware of where any given piece of data was coming from. You could therefore change your data storage later and ideally you would only have to change the abstraction layer, not the application itself. /---\ Casey Duncan, Sr. Web Developer National Legal Aid and Defender Association [EMAIL PROTECTED] \---/ ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
[Zope-dev] Curious problem with comprehensions and PythonScripts
Here's the situation: I have a dtml document with a list of questions under various headings, formatted like this: HEADING 1 question1 question2 question3 HEADING 2 question 4 question 5 I have a PythonScript that gives a list of only the questions to a Page Template: PythonScript called get_questions: data=container.data_document(None, None) # ignore blank lines # lines with no leading space are headings # lines with leading space are questions return [l for l in comps.splitlines() if l if l[0] is ' '] I'm rendering this using a page template: td tal:repeat=question container/get_questions The problem is, I'm often (always?) getting no questions rendered. However, if I change the python script to this, it works every time. PythonScript called get_questions: data=container.data_document(None, None) # ignore blank lines # lines with no leading space are headings # lines with leading space are questions questions = [l for l in comps.splitlines() if l if l[0] is ' '] return questions Any ideas what might be happening? I think the compiled code of the python script might be incorrect when directly returning the results a comprehension. -- Steve Alexander Software Engineer Cat-Box limited ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
[Zope-dev] Random.shuffle
Any particular reason why you can't use Random.shuffle from a PythonScript? Or any other methods of a Random object. I'd like to propose that restricted python be allowed access to methods of random.Random. I know that I can write a product to add a security declaration to random.Random, but I'd like this to be enabled by default in Zope. -- Steve Alexander Software Engineer Cat-Box limited ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] Random.shuffle
Steve Alexander wrote: Any particular reason why you can't use Random.shuffle from a PythonScript? Or any other methods of a Random object. I'd like to propose that restricted python be allowed access to methods of random.Random. I know that I can write a product to add a security declaration to random.Random, but I'd like this to be enabled by default in Zope. Surprisingly enough, you can set the global random seed from restricted python. That doesn't sound right to me. dtml-call _.random.seed(42) -- Steve Alexander Software Engineer Cat-Box limited ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] Curious problem with comprehensions and PythonScripts
Steve Alexander wrote: Any ideas what might be happening? I think the compiled code of the python script might be incorrect when directly returning the results a comprehension. Hmmm... it happened again. I think it might have something to do with the PythonScript falling out of the ZODB cache. I've changed the code to a filter(lambda ...) to see if it still happens with that. -- Steve Alexander Software Engineer Cat-Box limited ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] ZCatalog API
E. Seifert wrote: Hi list, as I'm not very familiar with the internals of ZCatalog I have a question to all you API experts: Why does ZCatalog.py (under Zope 2.4.1) specify a 'addIndex' permission for a method called 'manage_delIndexes' although there is no such method? The only method I could find to delete Indexes is 'manage_deleteIndex'. Can anyone comment on this? Thanks for pointing this out. There was some cruft in ZCatalog.py, which has now has been cleaned up. The changes are in CVS, and will be in the next release of Zope. The method manage_deleteIndex is still there, but is deprecated, and will issue a warning the first time it is called. You can use manage_delIndex instead. Both are protected by the addIndex permission. -- Steve Alexander Software Engineer Cat-Box limited ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
[Zope-dev] Product Icon
I am currently working on a product which has the sole purpose of referencing other objects. One of the properties is the path to another Zope object. Then methods are defined like getObject(), getPath(). We use it as a way to manage news and events that show on several sites that opperate on our Zope server. It allows one group to add a news document in their folder and if another group would like that news item to show on their site they can create a reference to it. Anyway, what happens from time to time is an object is referencing another object when it gets deleted/renamed/moved and that breaks the reference. The product handles this gracefully, however I would like to have the icon change from our standard icon to a broken icon. Any hints? --Brian Brinegar ECN Web Technician MSEE 104 A 494-3106 http://www.geeksoft.net/ ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] Product Icon
On Fri, 5 Oct 2001, marc lindahl wrote: We have schools, research groups, students, and administration that we deal with. A school may create a news document about a new professor which they would wish to display for 6 weeks. The administration offices may only wish to display the story for 1 week. The display dates for the news documents are properties of the documents. So I really need two different instances of the same property one for the school and one for the administration. However the administration probably has no permission other than View on the schools News Document so something like this would not work. We want to avoid maintaining two copies of the same story at all costs. The system I came up with was to let the administration create a reference to the schools news object where they could add their own properties or override the values of existing ones. If there is an editable record where an object could be cataloged and then the meta date for a cataloged object could be changed by the owner of the catalog it would provide the same functionality. I could just give each group a catalog and some methods of adding news to the catalog. They could then edit the meta_data in the catalog to change the display periods, priority, etc. And the display routine could use the meta_data in each groups catalog when displaying the object rather than the objects properties. Can this be done with Plugable Brains? If you have any other suggestions/hints/tips let me know. --Brian Why not use the Catalog for this? e.g. in the CMF, there's 'Topic' which does basically that. From: brian.r.brinegar.1 [EMAIL PROTECTED] Date: Fri, 5 Oct 2001 16:04:36 -0500 (EST) To: [EMAIL PROTECTED] Subject: [Zope-dev] Product Icon I am currently working on a product which has the sole purpose of referencing other objects. One of the properties is the path to another Zope object. Then methods are defined like getObject(), getPath(). We use it as a way to manage news and events that show on several sites that opperate on our Zope server. It allows one group to add a news document in their folder and if another group would like that news item to show on their site they can create a reference to it. Anyway, what happens from time to time is an object is referencing another object when it gets deleted/renamed/moved and that breaks the reference. The product handles this gracefully, however I would like to have the icon change from our standard icon to a broken icon. Any hints? --Brian Brinegar ECN Web Technician MSEE 104 A 494-3106 http://www.geeksoft.net/ ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope ) --Brian Brinegar ECN Web Technician MSEE 104 A 494-3106 http://www.geeksoft.net/ ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )