Re: [Zope-dev] Re: [Zope] Container Class questions
In article [EMAIL PROTECTED], Kapil Thangavelu [EMAIL PROTECTED] writes ... One of the things I wanted to do was to add a multiple selection property to the default properties in the Thing_add method. In order to do this in multiple zclasses I wanted to have a product wide variable/property/method to use as the allowed list. I could find no way to do that. As always with Zope there seem to be different inheritances/scopes at different times. Statically I can add a property to the product say projectList and it is visible when I add properties to a property sheet. So product wide things are visible statically, however projectList doesn't seem to be visible to my Thing_add method when I use manage_addProperty('projects','projectList','multiple selection') ie I get an error saying projectList isn't known. Clearly product wide methods are intended to be known at create time so why not properties? -- Robin Becker ___ 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] MailHost Improvements
There has been intermittent talk of improving mailhost's ability to scale. i just wanted to solicit some comments to some ideas for improving mail host performance. Stage I. Persistent Socket 1. make the smtp connection persistent 2. preface sending mail with a 'noop' operation to verify connection status 3. overide __setstate__ to open connection i'm not sure if this will yield any real world benefit but i like the style better than opening a new connection for every new message. Stage II. Transaction Aware 1. Store sent mail in a volatile 2. on transaction commit begin (tpc_begin), send all mail, if error abort transaction 3. reset volatile again i'm not sure of real world performance, but the design seems better and the added benefit that it will play nicely with the transaction machinery and not send unesc. emails. Stage III. Intelligent Q. aka the BulkMailHost 1. implement mailer thread / sole function to send mails from queue and intelligently manage a outgoing queue and deferred queue. 2. implement extensions to sendmail tag for immediate sending of mail which will wake/signal mailer thread after depositing into outgoing q. extension options are 3. mailer thread on a timer, so it will wake on either a sendmail tag with immeadiate extension or on timer expiration and send mail from queue, messages with error due to connection or placed in deferred queue. messages with undelivarable errors are either deleted or placed in a deleted queue. 4. all queues are viewable and manageable from the management interface. obviously this makes the sendmail tag async to the message being sent. i'm not sure if this something that really should be implemented in a ZODB default file storage due to the high write nature of the system or just dumped to the fs. again this seems questionable also because a proper mta should be operating on a store and send principle (qmail/postfix). comments? hmmm... looking through the source of the 2.2.2 mailhost i see a scheduledSend method, anyone know what this is from/for? Cheers Kapil ___ 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] ZPublisher.Client
I used to use Client.py quite a lot for calling zope objects through the web from python. However, now that I've upgraded to Zope 2.x it fails. (Zope 2.2 ZPublisher, connecting to Zope 2.1.2) Traceback (innermost last): File "/u/g/aedmondson/backups/pack_db.py", line 22, in ? pack() File "/u/g/aedmondson/backups/pack_db.py", line 19, in pack return(apply(Client.Function(place,username=user, password=pwd), (), kw)) File "/usr/local/ZOPE2.1.2/lib/python/ZPublisher/Client.py", line 221, in __call__ raise NotAvailable, RemoteException( bci.NotAvailable: (111, 'Connection refused') (File: http://localhost/Zope/fastcgi/Control_Panel/Database/manage_pack Line: days:int=0) None None for None (Both Zope 2.2 (in fact, the same python)) Traceback (innermost last): File "stdin", line 11, in ? File "stdin", line 8, in test File "/usr/local/Zope-2.2.0-linux2-x86/lib/python/ZPublisher/Client.py", line 221, in __call__ raise NotAvailable, RemoteException( bci.NotAvailable: argument 1: expected read-only character buffer, tuple found (File: http://localhost/idm Line: []) None None for None Is this a problem with ZPublisher, or me? Thanks, -Ed ___ 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] build Zope on linux
When building current zope cvs, cPickle.c want the mymath.h. Where can I get mymath? What devel package I should install for a debian system? Rgs, Kent Sin - kentsin.weblogs.com kentsin.imeme.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] build Zope on linux
On Mon, Oct 09, 2000 at 10:00:52PM +0800, Sin Hang Kin wrote: When building current zope cvs, cPickle.c want the mymath.h. Where can I get mymath? What devel package I should install for a debian system? To compile binary Python extensions with Debian (as Zope needs), you need the python-dev package: apt-get install python-dev Gregor ___ 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] basci properties
In message [EMAIL PROTECTED], Paul Erickson [EMAIL PROTECTED] writes Well I was trying to get a self contained class initialisation using a bit of python I had defined a propertsheet called ClassConstants containing a tokens property with "A B C" in my extern method initialiser I was doing self = self.this() obj = self.ZC.createInObjectManager(id, REQUEST) obj.manage_addProperty('t','tokenList','multiple selection') in the add form I could not seem to get access to the property tokenList ie I wasn't getting nice things from either dtml-with "_.namespace(S=tokenList)" not seeing the property. or dtml-with "_.namespace(S=Control_Panel.Products.myProduct.ZC.propertysheets.common .ClassConstants.getProperty('tokenList') failing with a permissions problem in the end I had to define a product external method called getTokenList which did def getQProjectList(self): obj = self.unrestrictedTraverse("Control_Panel/Products/myProduct/ZC/propert ysheets/common/ClassConstants") return obj.getProperty('tokenList') How does one define properties which are visible at construction time? Just create a ZClass that inherits from ObjectManager, then you will have to use the Subobjects tab to tell it what kind of objects it can contain. For properties, click on the Property Sheets tab and add one (be sure you're in the class, not the product). Put whatever properties on it that you like. Remember that properties won't get set in the constructor unless you uncomment the dtml-call "propertysheets.Basic.manage_editProperties( REQUEST)" line in the constructor. (change "Basic" if that's not what you called your property sheet. Robin Becker wrote: I want to create a ZClass that is essentially a folder with some added properties. I can see no way to add to the Basic properties of my ZClass. Is there a way to do that? -- Robin Becker ___ 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 ) -- Robin Becker ___ 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] Strange permissions in the (built-in) API reference
I have just thouroughly looked through the API reference which is built in Zope 2.2.2. I found many strange permission statements, e.g.: * all methods of "PropertySheets" can only be used from Python * while "PropertySheet.propertyItems" can be used with permission "Access Contents Information", "PropertySheet.getProperty" can be used from Python only * "ObjectManagerItem.restrictedTraverse" can be used from Python only * some permission are given as "XXX" (e.g. "ObjectManagerItem.this") I wonder, if this is caused by the API reference being shipped with "data.fs.in" (which, in my case, is old, at least 2.2.1). If this would be the case, then it might be better to have such documentation outside in the file system, as "data.fs" tends to taken over from older installations to newer ones. Besides, there are many small problems with structured text. One particular instance is the removal of default arguement values '', caused by the interpretation of "'". Dieter ___ 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] Re: Trying to catch up - what are the best Zope tools today?
Itai asked: "I started reading about ZPatterns but I still can't get my head around it... I'm wondering if I should try to learn it fast enough for this project, or stick to what I already know. What in people's experience is the typical learning curve for ZPatterns? How much am I going to have to figure out to be able to build support for SQL storage? FYI ZPatterns has been a rapidly moving target, but it's looking pretty solid now, and a few folks have managed to wade in and make sense of it already. There's even some documentation at : http://www.zope.org/Members/pje/Wikis/ZPatterns/HomePage Most of the discussions you'll see on this list between Steve Spicklemire and Phil Eby / Ty Sarna are directly related to the next rev. of EMarket, which will be based on ZPatterns. If you think the flexibility that comes from a cleanly implemented Object Pattern will be worth the learning curve, ZPatterns is just about there now. The "how" of storing data in an RDBMS, accessed with ZSQLMethods is no different with ZPatterns. The real difference is "who" does the storage and retrieval. This is the concept of the "Specialist" object, which "knows" all about the specifics of the data and storage implementation. In any case, get to know ZClasses and PythonMethods, which may not have been ready for prime time, or even released, last time you looked. Those will be useful no matter which direction you choose. Later, Jerry S. Thanks. I did work with ZClasses and PythonMethods - I wasn't gone that long. I couldn't see how ZPatterns are actually implemented, regardless of what tools are used - but I'm getting it slowly, mostly by collecting a lot of tips from posts in the list over the past few months. ZPatterns looks great and definitely worth the learning curve - I'm off to buy Coad's book so I can do it right. -- Itai Tavor"Je sautille, donc je suis." C3Works[EMAIL PROTECTED] - Kermit the Frog "If you haven't got your health, you haven't got anything" ___ 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] Anonymous logins
Hi all How can i restrict Anonymous logins to a domain. Thanks Mark ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
[Zope] security quickie
Does Zope security provide a way of restricting what objects are listed to an authenticated user inside the Zope 'manage' interface? I'm getting my head all twisted up over this security / proxy roles /local roles lark. Thanks, seb ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
RE: [Zope] overriding __str__ method?
Thanks for the reply, Either I don't understand the problem or you're making it too complicated. g I think both, but mostly the latter ;) Explanation MK II: I know how to create a form that does what I want (update properties, whatever). What I don't know is how to include it as part of the rendered content programmatically. At the moment users have to go to www.widgets.com/manage_content, log in, and see a set of forms loosely based on the Zope manage interface. Instead, I'd like them to go to the same url, and see exactly the same website as someone who's not logged in, except they have these lovely little "edit this" buttons next to each editable content element (by which I mean image, text snippet, etc). Now I *could* do a dtml-if "AUTHENTICATED_USER.has_role('content manager')" a href="edit_this"edit this/a /dtml-if in each content element. But I'd much rather be able to subclass or mixin an 'editable' class for each content element in question. The question is, what methods should I be providing to manipulate how the content is rendered? For example, I can provide a new 'view' method in the 'views' tab for a ZClass, but this does not get called when an object is rendered as part of another document. The reason I was going on about __str__ is because that seems to be the only place that you can interfere with how the content is rendered inline? Hope that's clearer, seb. You have a form to edit the properties. ... input type="text" name="last_name" value="dtml-last_name;" ... The action method of this form sets the REQUEST variables to the property names: ... dtml-call "REQUEST.set('last_name', REQUEST['last_name'])" ... (I generally use the same names for form vars and property names to avoid confusing myself) then: dtml-call "manage_changeProperties(REQUEST)" Does this help? Seb Bacon wrote: My strategy: Each element that I want the user to be able to edit is a ZClass with a manage_content method. This provides the custom management view (e.g. combines properties and title/data into a single form). Now I want a way to give the user access to this screen. I could do a new version of the folders tree view (manage_menu), but what I'd really like to do is have a button next to each of these elements ("edit this") which calls its manage_content method. The button would only appear when the user was authenticated / authorised. My problem: The only place I can think of doing this is in each object's __str__ method. But AFAIK there's no convenient way of overriding its default behaviour. What I'd like to do is override it in the ZClass views interface. I can override the 'View' method (from the ZClass 'views' tab), but that doesn't get called in the course of rendering a component in a page. The problem would seem to be that there's no equivalent of the __str__ method available to override... Or is there? ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] status of SOAP for Zope?
On Fri, 6 Oct 2000 11:20:38 -0400, "Brian Lloyd" [EMAIL PROTECTED] wrote: This is a very important point - I think people would rather be able to implement SOAP services selectively rather than by One Big Switch that may expose just about anything. I would very much like to see a project started on dev.zope.org that starts off by drafting a "user manual" that describes how SOAP services would be implemented from the standpoint of a Zope developer. This would give us a good way to come to agreement without worrying about code just yet. Ive been considering this point of view over the weekend, and I think I disagree. Zope already has a perfectly good definition of 'web service' - the definition used by ZPublisher and the xml-rpc implementation (and FTP, to a lesser extent). Developing Zope services already involves enough detail - An extra layer of abstraction here is undesirable. I suspect many people using xml-rpc are, like me, not completely satisfied with its feature set. Id been looking to soap to fill these holes, and I would be disappointed if soap wasnt implemented in the same way. Some attention should be given to how SOAP services get exposed by other systems at this point (they do *not* just suddenly expose every in-memory object to SOAP). And that's plainly not the case for Petru Paler's soap implementation - he only exposes the same objects and methods exposed by ZPublisher. There are a number of people who have recently voiced their (legitimate) concern that by default *practically everything* on their site is xml-rpc enabled Those people were concerned that too many things were exposed via ZPublisher also My interpretation was that the issue is one of access control, not publishing protocol. Toby Dickenson [EMAIL PROTECTED] ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
[Zope] CatalogReindex deletes !!!
Hi, I just got a weird "error" this morning. I have a ZCatalog with some ZClasses which is index in it. But when I use the "Update Catalog" function it deletes ALL entries in the catalog !!! Any ideas ?? No errors returned. Just Nothing. Using Zope 2.2.2 on Linux. I have restarted and packed Zope and reinstalled the ZCatalog without success. -- Regards - Anders Holmbech Nielsen | Tlf: (+45) 70 22 56 00 Software Engineer | Fax: (+45) 70 22 57 00 Integrator Uniware A/S | http:/www.integrator.dk ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Zope in Windows is faster than Linux ???
On Sat, 07 Oct 2000 01:57:40 +0200, "Ansgar W. Konermann" [EMAIL PROTECTED] wrote: Definitely, yea! I would really be interested in its correct results. We have been stress testing our Zope application on NT and Linux. Our conclusion is that OS is not a factor in Zope performance. Toby Dickenson [EMAIL PROTECTED] ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
[Zope] Access Control vs Publishing Protocol
Toby Dickenson wrote: Those people were concerned that too many things were exposed via ZPublisher also My interpretation was that the issue is one of access control, not publishing protocol. I think the issue is that you can't limit the visibility of objects right now. You can limit their access easily enough (or more tortuously if you don't want people to access the bits of a page on their own (standard_*,etc) via a complex web of proxy roles and required permissions) but there doesn't appear to be any easy way to say "right, I want this object exposed for reading and writing via FTP and reading via HTTP, while this one shouldn't be URL traversable but I'd like to edit it via WebDAV and this method is for use via XML-RPC but really shouldn't be visible anywhere else.) You can hack some of it with clever SiteAccess usage but it is a hard problem. Ideally, you'd also want anything that deals with the above to be related to user roles as well. This is because the thing which makes the problem hard is that something like standard_html_header wants to be editable by Managers TTW, which means it also has to be visible TTW. However, it's probably not something you want exposed to anonymous users, especially as a TTW enitity in its own right. objectIds is my other favourite example ;-) What do other peiople think? What would be the overhead of introducing the above type of publishign restrictions? cheers, Chris ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] CatalogReindex deletes !!!
You're not the only one. My catalog does the same strange things. I got the same Zope version. Perhaps a bug in ZCatalog. Anders Holmbech Nielsen wrote: Hi, I just got a weird "error" this morning. I have a ZCatalog with some ZClasses which is index in it. But when I use the "Update Catalog" function it deletes ALL entries in the catalog !!! Any ideas ?? No errors returned. Just Nothing. Using Zope 2.2.2 on Linux. I have restarted and packed Zope and reinstalled the ZCatalog without success. -- Regards - Anders Holmbech Nielsen | Tlf: (+45) 70 22 56 00 Software Engineer | Fax: (+45) 70 22 57 00 Integrator Uniware A/S | http:/www.integrator.dk ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev ) ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Zope in Windows is faster than Linux ???
On Sat, 07 Oct 2000 01:57:40 +0200, "Ansgar W. Konermann" [EMAIL PROTECTED] wrote: Definitely, yea! I would really be interested in its correct results. We have been stress testing our Zope application on NT and Linux. Our conclusion is that OS is not a factor in Zope performance. Toby Dickenson [EMAIL PROTECTED] Can we see some profiling data from that to support your statement? Regards, Knight [EMAIL PROTECTED] ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
RE: [Zope] overriding __str__ method?
so if i'm not mistaken you want to be able to include an object instance with say dtml-var myinstance and, depending on the user being authenticated, have that object render with "edit this" button or without? overriding the __str__ method can afaik only be done inside a python product (read the python product tutorial) you could use lalo's "Renderable Base ZClass" product or call your instance like so: dtml-with myinstance dtml-var method_that_renders_myinstance /dtml-with (or call it dtml-var "myinstance.method_that_renders_myinstance(_.None,_)") and in the "method_that_renders_myinstance" you'd render those "edit" buttons only if theres the correct role in AUTHENTICATED_USER hth peter sabaini. On Mon, 9 Oct 2000, Seb Bacon wrote: :Thanks for the reply, : : Either I don't understand the problem or you're making it too : complicated. g : :I think both, but mostly the latter ;) : :Explanation MK II: : :I know how to create a form that does what I want (update properties, :whatever). What I don't know is how to include it as part of the rendered :content programmatically. At the moment users have to go to :www.widgets.com/manage_content, log in, and see a set of forms loosely based :on the Zope manage interface. Instead, I'd like them to go to the same url, :and see exactly the same website as someone who's not logged in, except they :have these lovely little "edit this" buttons next to each editable content :element (by which I mean image, text snippet, etc). : :Now I *could* do a : : dtml-if "AUTHENTICATED_USER.has_role('content manager')" :a href="edit_this"edit this/a : /dtml-if : :in each content element. But I'd much rather be able to subclass or mixin an :'editable' class for each content element in question. The question is, :what methods should I be providing to manipulate how the content is :rendered? For example, I can provide a new 'view' method in the 'views' tab :for a ZClass, but this does not get called when an object is rendered as :part of another document. The reason I was going on about __str__ is :because that seems to be the only place that you can interfere with how the :content is rendered inline? : :Hope that's clearer, : :seb. : : : : : : : You have a form to edit the properties. : ... : input type="text" name="last_name" value="dtml-last_name;" : ... : : The action method of this form sets the REQUEST variables to the : property names: : ... : dtml-call "REQUEST.set('last_name', REQUEST['last_name'])" : ... : (I generally use the same names for form vars and property names : to avoid confusing myself) : : then: : dtml-call "manage_changeProperties(REQUEST)" : : Does this help? : : : Seb Bacon wrote: : : My strategy: : Each element that I want the user to be able to edit is a ZClass with a : manage_content method. This provides the custom management view (e.g. : combines properties and title/data into a single form). : Now I want a way to give the user access to this screen. I : could do a new : version of the folders tree view (manage_menu), but what I'd : really like to : do is have a button next to each of these elements ("edit : this") which calls : its manage_content method. The button would only appear when : the user was : authenticated / authorised. : : My problem: : The only place I can think of doing this is in each object's : __str__ method. : But AFAIK there's no convenient way of overriding its default behaviour. : What I'd like to do is override it in the ZClass views interface. I can : override the 'View' method (from the ZClass 'views' tab), but : that doesn't : get called in the course of rendering a component in a page. : The problem : would seem to be that there's no equivalent of the __str__ : method available : to override... Or is there? : : :___ :Zope maillist - [EMAIL PROTECTED] :http://lists.zope.org/mailman/listinfo/zope :** No cross posts or HTML encoding! ** :(Related lists - : http://lists.zope.org/mailman/listinfo/zope-announce : http://lists.zope.org/mailman/listinfo/zope-dev ) : -- _ peter sabaini, mailto: [EMAIL PROTECTED] - ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
[Zope] input type=checkbox name not pushed to zsql method namespace
hi, it seems to me that the variable name corresponding to a checkbox into a form is not pushed to the namespace of the SQL query when it's not checked. if it's checked, it works fine. the error reported is related to the argument list entry corresponding to the name of the checkbox into the zsql method. thanks a lot. - Beuserie Frederic DSI / Système et Exploitation - 3 Suisses Belgique Tel: +3269/882485 / Fax: +3269/882491 Email: [EMAIL PROTECTED] ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
[Zope] cookies don't obey me
I've been experiencing two problems with cookies from Zope: 1) When I set a cookie with the path set to the root dtml-call "RESPONSE.setCookie('account',AUTHENTICATED_USER,path='/')" I'm still not able to click through to another hyperlink once I'm logged in, i.e., I've used www.ddi.nl/support to go the password protected Zope site, logged in as a customer, and from there I can choose other parts of the site (below .../support/). However, www.ddi.nl is an alias of www.datadistilleries.com (the actual name): as a result it asks me for the password again. I thought setting the path to '/' would convince Zope I'm authorized, but apparently it's not the case. 2) This might be related to 1. I've created a logout link on the .../support/index_html page, which looks as follows: dtml-call "RESPONSE.expireCookie('account',path='/')" dtml-call "RESPONSE.redirect('http://www.datadistilleries.com/support.html?section=m6envelope=6')" However, once I've been redirected I can still access the password protected .../support/ site without Zope asking me for a login name. Now, I'm not 'cookie guru', so please don't tell me how stupid it is of me that I didn't think of this or that to make it work. I did do my background research homework though! Thanks for reading this far ;-). RCR _ Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com. Share information about yourself, create your own public profile at http://profiles.msn.com. ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] input type=checkbox name not pushed to zsql method namespace
this is the standard behaviour in a HTML form. To avoid this problem we include an line like this: dtml-if "REQUEST.has_key('CheckBox_name')" dtml-else dtml-call "REQUEST.set('CheckBox_name', 'N')" /dtml-if in the method that receives the form data. Hope this help =?iso-8859-1?Q?Beuserie_Fr=E9d=E9ric_=28stbrice_dsi=29?= escribió: hi, it seems to me that the variable name corresponding to a checkbox into a form is not pushed to the namespace of the SQL query when it's not checked. if it's checked, it works fine. the error reported is related to the argument list entry corresponding to the name of the checkbox into the zsql method. thanks a lot. - Beuserie Frederic DSI / Système et Exploitation - 3 Suisses Belgique Tel: +3269/882485 / Fax: +3269/882491 Email: [EMAIL PROTECTED] ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev ) ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Animated GIFs
Peter Bengtsson schrieb: [Just checking.] Have you tried to acctually _use_ the animated gif in context with other HTML? I have experienced problem some single time with images (can't remember what the problem/image was) viewed directly from the View management tab. Excuse the childish suggestion. Any help is appreciated!!! I tried your suggestion. The animGif works fine with every kind of HTML. I really think it's a Zope problem. Also the gif downloaded from Zope works with HTML outside Zope. The following doesn't work as well: Refer to the gif situated on your Zope server from a HTML file outside Zope. - Same problem... html headtitlethe title/title/head bodyimg src="http://localhost:8080/animGif"/body /html I also tried to name the animGif explicitely animGif.gif instead of animGif - guessed what? - same problem! Any more ideas, please? Thanks. Lars - Original Message - From: "Lars Heber" [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, October 06, 2000 3:24 PM Subject: [Zope] Animated GIFs Hi there, I've got a strange problem. I want to upload an animated GIF to my Zope, but when I want to view it, animation stops at the last frame instead of looping indefinitely. When not uploaded to Zope, the animation works fine, also, when I download the GIF by rightclick from a Zope site and view it again outside Zope, it works perfectly! What's going on here??? Any ideas? PS.: The content_type is image/gif. Do animGifs have another one? Just an idea... ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Animated GIFs
Sorry, forgot the html quoting in my last posting... Should work now. Peter Bengtsson schrieb: [Just checking.] Have you tried to acctually _use_ the animated gif in context with other HTML? I have experienced problem some single time with images (can't remember what the problem/image was) viewed directly from the View management tab. Excuse the childish suggestion. Any help is appreciated!!! I tried your suggestion. The animGif works fine with every kind of HTML. I really think it's a Zope problem. Also the gif downloaded from Zope works with HTML outside Zope. The following doesn't work as well: Refer to the gif situated on your Zope server from a HTML file outside Zope. - Same problem... lt;html lt;headlt;titlethe titlelt;/titlelt;/head lt;bodylt;img src="http://localhost:8080/animGif"lt;/body lt;/html I also tried to name the animGif explicitely animGif.gif instead of animGif - guessed what? - same problem! Any more ideas, please? Thanks. Lars - Original Message - From: "Lars Heber" [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, October 06, 2000 3:24 PM Subject: [Zope] Animated GIFs Hi there, I've got a strange problem. I want to upload an animated GIF to my Zope, but when I want to view it, animation stops at the last frame instead of looping indefinitely. When not uploaded to Zope, the animation works fine, also, when I download the GIF by rightclick from a Zope site and view it again outside Zope, it works perfectly! What's going on here??? Any ideas? PS.: The content_type is image/gif. Do animGifs have another one? Just an idea... ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Zope in Windows is faster than Linux ???
We have been stress testing our Zope application on NT and Linux. Our conclusion is that OS is not a factor in Zope performance. Can we see some profiling data from that to support your statement? Its all application-specific, and theres nothing I can release at the moment. Essentially the timings were all within a 15% band after a little tweaking. Personally I don't think this result is at all suprising: In a loaded Zope system the processor spends all its time executing the python VM, not OS code. Toby Dickenson [EMAIL PROTECTED] ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
[Zope] Displaying zope content on other websites using XML
Hi, Can we display zope content on other web sites via xml or some kind of a script? What I had in mind was something on the lines of moreover news (www.moreover.com) that syndicates its content to other web sites. I'd appreciate any help. Thanks. ___ GO.com Mail Get Your Free, Private E-mail at http://mail.go.com ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
RE: [Zope] Animated GIFs
I also tried to name the animGif explicitely animGif.gif instead of animGif - guessed what? - same problem! Any more ideas, please? have you tried doing a diff on the zope and non-zope versions to see if zzope's somehow mangled it? seb ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
[Zope] Re: [Zope-dev] build Zope on linux
Hi, Kent Sin dpkg -S tells you what package contains a file: jwashin@vpave5:/$ dpkg -S mymath.h python-dev: /usr/include/python1.5/mymath.h So, it would appear the python-dev package is the one you need. -- Jim Washington Sin Hang Kin wrote: When building current zope cvs, cPickle.c want the mymath.h. Where can I get mymath? What devel package I should install for a debian system? Rgs, Kent Sin - kentsin.weblogs.com kentsin.imeme.net ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Animated GIFs
Seb Bacon schrieb: I also tried to name the animGif explicitely animGif.gif instead of animGif - guessed what? - same problem! Any more ideas, please? have you tried doing a diff on the zope and non-zope versions to see if zzope's somehow mangled it? seb Yes, I did. They were absolutely identical! I 'diffed' the original and the up- and redownloaded version. Perhaps I should 'diff' the original with the version which is inside Zope - but how to do this?!? It's an object, isn't it? ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Access Control vs Publishing Protocol
Chris Withers wrote: Toby Dickenson wrote: Those people were concerned that too many things were exposed via ZPublisher also My interpretation was that the issue is one of access control, not publishing protocol. I think the issue is that you can't limit the visibility of objects right now. You can limit their access easily enough (or more tortuously if you don't want people to access the bits of a page on their own (standard_*,etc) via a complex web of proxy roles and required permissions) but there doesn't appear to be any easy way to say "right, I want this object exposed for reading and writing via FTP and reading via HTTP, while this one shouldn't be URL traversable but I'd like to edit it via WebDAV and this method is for use via XML-RPC but really shouldn't be visible anywhere else.) It seems like this can be handled rather well by simply adding a 'XML-RPC access', a 'SOAP access' and a 'WebDAV access' set of permissions. we already have a 'FTP access' permission which works fine. Thse could then be matched with appropriate 'view' permissions as well. On a slightly different note, I think that the permissions list should be viewable in two more ways: A view where permissions are grouped into 'subjects', (for example all the ones I just mentioned should go into a 'access protocol' subject and possibly a 'view protocol' subject) and another view where permissions are grouped according to the roles that have them. These different views should all be on the same tab, with hyperlinks to switch between them (sort of like the 'local roles' screen is linked from 'security'). Michael Bernstein. ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
RE: [Zope] Animated GIFs
right-clicking the image in question and "save image as..." should give you the precise data that zope's storing internally - that's what you did, right? it seems very unlikely to me that zope does mangle images though. and doubly unlikely that it unmangles them again just for your diff. is it a browser-related issue? have you tried it in IE netscape? if you want to send me the gif i'll try it out, when i get some time (tomorrow probably) seb -Original Message- From: Lars Heber [mailto:[EMAIL PROTECTED]] Sent: 09 October 2000 15:29 To: Seb Bacon Cc: [EMAIL PROTECTED] Subject: Re: [Zope] Animated GIFs Seb Bacon schrieb: I also tried to name the animGif explicitely animGif.gif instead of animGif - guessed what? - same problem! Any more ideas, please? have you tried doing a diff on the zope and non-zope versions to see if zzope's somehow mangled it? seb Yes, I did. They were absolutely identical! I 'diffed' the original and the up- and redownloaded version. Perhaps I should 'diff' the original with the version which is inside Zope - but how to do this?!? It's an object, isn't it? ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
RE: [Zope] Access Control vs Publishing Protocol
It seems like this can be handled rather well by simply adding a 'XML-RPC access', a 'SOAP access' and a 'WebDAV access' set of permissions. we already have a 'FTP access' permission which works fine. Not quite. That permission controls several methods that are particularly useful for FTP (indeed, you cant do FTP without them). However you could also call those methods using xml-rpc, soap, or ZPublisher (or, not, depending on the whether you have the 'FTP access' permission). Your suggestion makes sense for WebDAV which, like FTP, only uses a small set of methods. I dont think its appropriate for a more flexible protocol like xml-rpc, soap, or ZPublisher. ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Displaying zope content on other websites using XML
Hi "[EMAIL PROTECTED]"! Have you taken a look at a) Amos Latteier's "RSS Channel" product: http://www.zope.org/Members/Amos/RSSChannel.tgz (and his article on xml.com http://www.xml.com/pub/2000/02/23/zope/index.html) (the product is based on Amos's "XMLDocument product": http://www.zope.org/Products/XMLDocument) b) Ed Dumbill's "SiteSummary" product: http://www.zope.org/Members/edmundd/SiteSummary c) Kapil Thangavelu's "NewsCenter" product: http://www.zope.org/Members/k_vertigo/ZopeProducts/NewsCenter d) Kevin Dangoor's "KM|Net News" product: http://www.zope.org/Members/taz/kmnn ??? Or maybe I just misunderstood you. Prost, Danny -Ursprüngliche Nachricht- Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]Im Auftrag von blueeye Gesendet: Montag, 9. Oktober 2000 15:45 An: [EMAIL PROTECTED] Betreff: [Zope] Displaying zope content on other websites using XML Hi, Can we display zope content on other web sites via xml or some kind of a script? What I had in mind was something on the lines of moreover news (www.moreover.com) that syndicates its content to other web sites. I'd appreciate any help. Thanks. ___ GO.com Mail Get Your Free, Private E-mail at http://mail.go.com ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev ) ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] 'Offline' mailhost
Michael Bernstein wrote: "Jan H. Haul" wrote: Each of these will be around 42 KByte large. Huh? Why that? you ask. Because in the header of each mail, the whole recipient list will be listed under To: or Cc: [snip] - privacy: You would not like to have "your" recipients end up on other people's mailing lists What about using BCC: ? That would effectively sending one separate mail to each recipient, without giving you the full benefit of being able to identify each in case of bounces. I'd recommend using mailing list processing software (ezmlm on qmail is especially handy, or majordomo) for the task - it is in fact written for just this, and makes your life so much easier. If someone insists in reinventing wheels, well, Monty Python has a nice sketch on the topic :-) Jan ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] DTML Method not working
Is the code you used in a DTML Method or a DTML Document? I had it in a DTML Method. It was in the standard public interface index_html that is a DTML method. Is it in a DTML Method being called from a DTML Document? No, the standard_html_header calls the method. Actually, I just copied the code/instructions from the Zope Book (http://www.zope.org/Members/michel/ZB/). Incidentally, once I put your dtml-with ... modification, it worked just fine. Thanks! This however, begs (a newbie's) question as to how to get a listing of the current folder's contents. I.e., using a DTML Method (such as the stadard index_html), what changes to the code that you provided would look up the current container's (folder) objects? Wouldn't you use something like PARENT, i.e., the parent object of the DTML method that is used to render the web page? Or would you simply modify the I'm going to suggest to the author of the upcoming Zope book to add a little of your explanation here, as it would be very instructive. You helped. Thanks very much. Ron ./. You could try something like: dtml-with expr="resolve_url(BASE0+'/')" ul dtml-in expr="objectValues('Folder')" lia href="dtml-absolute_url;"dtml-var title_or_id/abr/li /dtml-in /ul /dtml-with The resolve_url(BASE0+'/') should give you a reference to the top Zope object (root). hth Phil [EMAIL PROTECTED] - Original Message - From: "Ronald L. Chichester" [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Sunday, October 08, 2000 8:58 PM Subject: [Zope] DTML Method not working I took some code that was in the (work-in-progress) O'Riley book on Zope. In that example, then had a DTML Method used for identifying folders and hyperlinking to them. The code is as follows: ul dtml-in expr="objectValues('Folder')" lia href="dtml-absolute_url;"dtml-var title_or_id/abr/li /dtml-in /ul The problem is, it doesn't work. I know the method is being invoked because there is some other text that is indeed being inserted. Moreover, there are sub-folders in the folder that calls the method. Does anyone know what the problem is? Is it a permission issue. The standard_html_header and _footer, show up just fine, along with logos and such. The only part that isn't showing up is the stuff that was supposed to be generated by the dtml-in block. Any hints? Thanks in advance. Ron ./. ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev ) ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] DTML Method not working (Please disregard, I figured it out)
Is the code you used in a DTML Method or a DTML Document? I figured out (later) that it was indeed the DTML Method/Document issue on the latter part of my question. Please disregard my last mesage. Thanks for your help. Ron ./. ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
[Zope] Fw: Re: [Zope] Animated GIFs
Seb Bacon schrieb: I also tried to name the animGif explicitely animGif.gif instead of animGif - guessed what? - same problem! Any more ideas, please? have you tried doing a diff on the zope and non-zope versions to see if zzope's somehow mangled it? seb Yes, I did. They were absolutely identical! I 'diffed' the original and the up- and redownloaded version. Perhaps I should 'diff' the original with the version which is inside Zope - but how to do this?!? It's an object, isn't it? Perhaps you should use a tool like tcpdump to do a raw dump of the tcp-data which is sent. Or just look at the http-headers with a tool like samspade (http://www.samspade.org/ssw/). Perhaps there is a problem with them (differing content-length?) - maybe triggering a bug in IE. cheers, oliver ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
[Zope] tell-a-friend product?
Hi, I am still new to zope and am wondering if there is a tell-a-friend script/product/example floating around for me to look at? If not, and I made my own form with Zope (which I have not done yet), what variable would call the existing page the user was on ? Thanks in advance. --Sean ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
[Zope] dtml-tree advice, please
Consider the following situation: - I have two ZClasses. One ("Album") is folderish, and serves as a photo album. The other ("Photo") isn't and serves as a photo in an Album. Albums can contain only Albums and Photos. I would like to have a dtml-tree represent this hierarchy of Albums and Photos. The Question: - should I use dtml-tree branches_expr="objectValues('Album')" .. dtml-tree branches=objectValues .. dtml-tree branches=tpValues .. dtml-tree ??? Things to consider: --- I need the branches to represent two different meta types, Album and Photo. If I use branches_expr="objectValues('Album') I'll see the tree rendered with only Albums, and no Photos shown. If I use branches=objectValues then I'll see EVERYTHING in the current folder and, at the top level, peer to the root of any Album hierarchy, there may be other objects like dtml documents, methods, etc. I don't want to see those. If I use branches=tpValues (..still learning this one..) I'll see any object (?) in the current folder (?). This seems to work best in experiment, but what if I were to define and instantiate some unrelated ZClass and happen to have one in the current folder with an Album. I tend to think that it would be rendered in my dtml-tree with the Albums and Photos.. ..If anyone can recommend a source of documentation (be specific, no RTFM's please) that would help me solve this myself, that, too, would be welcome. Brian Withun ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
[Zope] Odd SQL errors- HELP
Hello, I have Zope 2.2.2 running with a MySQL database, and everything _was_ working fine until I started to play with the new database structure our dba came up with for tracking our recruiting process... anyway, i have a db named recruit, with a MySQLDA connection object to it that works, but on mnay of the tables I get an error such as the one pasted below when I attempt to do a simple query... Now, the state table does not return this error and has this structure: (as cut-n-pasted from the mysql monitor) +---+-+--+-+-+---+ | Field | Type| Null | Key | Default | Extra | +---+-+--+-+-+---+ | state | char(2) | | PRI | | | +---+-+--+-+-+---+ meanwhile any of our tables with 'id' fields choke with the keyerror: unhandled, heres an example table struct: +---+--+--+-+-++ | Field | Type | Null | Key | Default | Extra | +---+--+--+-+-++ | id| mediumint(8) | | PRI | 0 | auto_increment | | value | varchar(32) | | | || +---+--+--+-+-++ Now, at first i thought it was the field name of 'id' causing the problem, but now I've tried renaming the field and its still a no-go. I can do queries such as 'select value from reason' fine, but if i select * or the id field, it chokes... Looking through the mailinglist archives, I think its a 'mapping error' where the ZmySQLDA doesn't properly map this type of field for some reason... can someone help me solve this problem? Yes, I can change the db, but thats really not an acceptable option, since the dba will then just go 'Well, if zope cant handle a simple db structure without changing field name and/or types, then i refuse to sign off on using zope as a development tool!' Zope Error Zope has encountered an error while publishing this resource. Error Type: KeyError Error Value: unhandled Troubleshooting Suggestions This resource may be trying to reference a nonexistent object or variable unhandled. The URL may be incorrect. The parameters passed to this resource may be incorrect. A resource that this resource relies on may be encountering an error. For more detailed information about the error, please refer to the HTML source for this page. If the error persists please contact the site maintainer. Thank you for your patience. Traceback (innermost last): File /usr/local/zope/2.2.0/lib/python/ZPublisher/Publish.py, line 222, in publish_module File /usr/local/zope/2.2.0/lib/python/ZPublisher/Publish.py, line 187, in publish File /usr/local/zope/2.2.0/lib/python/Zope/__init__.py, line 221, in zpublisher_exception_hook (Object: RoleManager) File /usr/local/zope/2.2.0/lib/python/ZPublisher/Publish.py, line 171, in publish File /usr/local/zope/2.2.0/lib/python/ZPublisher/mapply.py, line 160, in mapply (Object: manage_test) File /usr/local/zope/2.2.0/lib/python/ZPublisher/Publish.py, line 112, in call_object (Object: manage_test) File /usr/local/zope/2.2.0/lib/python/Shared/DC/ZRDB/Connection.py, line 180, in manage_test (Object: RoleManager) File lib/python/Products/ZMySQLDA/db.py, line 191, in query KeyError: (see above) ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
[Zope] ZMysqlDA error, and a workaround
This is additional info for the error mentioned in my last email. If I alter the column definitions to use 'int' as opposed to 'mediumint', then everything works fine! So, its the 'mediumint' type that isnt mapping properly... where would i fix this? ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] tell-a-friend product?
Sure.. http://fundraising.gotschool.com/tell_a_friend.html Is that what you want? J From: [EMAIL PROTECTED] Date: Mon, 9 Oct 2000 11:02:36 -0700 To: [EMAIL PROTECTED] Subject: [Zope] tell-a-friend product? Hi, I am still new to zope and am wondering if there is a tell-a-friend script/product/example floating around for me to look at? If not, and I made my own form with Zope (which I have not done yet), what variable would call the existing page the user was on ? Thanks in advance. --Sean ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev ) ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
RE: [Zope] tell-a-friend product?
Hi, I am still new to zope and am wondering if there is a tell-a-friend script/product/example floating around for me to look at? If not, and I made my own form with Zope (which I have not done yet), what variable would call the existing page the user was on ? The url of the current page is URL0. Check out the environment variables in the Zope Quick Reference or do a dtml-var REQUEST to dump them all. You'll want to use the sendmail tag to send the link to the friend. good luck, seb ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] dtml-tree advice, please
Brian Withun wrote: I need the branches to represent two different meta types, Album and Photo. If I use branches_expr="objectValues('Album') I'll see the tree rendered with only Albums, and no Photos shown. Not sure of the consequences in the tree tag. But objectValues() accepts multiple arguments. Try: branches_expr="objectValues('Album' 'Photo') HTH, -- Tim Cook -- Cook Information Systems | Office: (901) 884-4126 8am-5pm CDT * It's easy to stop making mistakes. Just stop having ideas. * FreePM Project Coordinator http://www.freepm.org OSHCA Founding Supporter http://www.oshca.org ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
[Zope] (Off-Topic) A Haiku
A thousand apologies for such blatantly offtopic drivel, but this leaped into my mind today and I figured if anyone could appreciate it, it'd be somebody on this list. a haiku: request bracket tick base zero tick bracket plus tick slash manage tick (Apply capitalizations and numeric conversions where appropriate.) Back to your regularly scheduled list . . . -CJ ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
[Zope] expr=id 'index_html issue
Okay, this is my second question for the day. Hopefully it won't be as easy as the first -- otherwise, I'll have to stick to practicing law. I'm looking for a way to list the DTML Methods in a folder -- except the index_html method. So far, I've had to do it by using this: dtml-in expr="objectValues('DTML Method')" sort="title" dtml-if expr="title 'The Title'" td align="center"a href="dtml-absolute_url;"dtml-var title_or_id/a/td /dtml-if /dtml-in This works but it is a maintenance headache. A more elegant (and reuseable) solution would be to use the id, which is always 'index_html' for the to-be-excluded method. However... dtml-in expr="objectValues('DTML Method')" sort="title" dtml-if expr="id 'index_html'" td align="center"a href="dtml-absolute_url;"dtml-var title_or_id/a/td /dtml-if /dtml-in .. doesn't work. Does anyone know why? Thanks in advance, Ron ./. ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] expr=id 'index_html issue
Okay, this is my second question for the day. Hopefully it won't be as easy as the first -- otherwise, I'll have to stick to practicing law. I'm looking for a way to list the DTML Methods in a folder -- except the index_html method. So far, I've had to do it by using this: dtml-in expr="objectValues('DTML Method')" sort="title" dtml-if expr="title 'The Title'" td align="center"a href="dtml-absolute_url;"dtml-var title_or_id/a/td /dtml-if /dtml-in This works but it is a maintenance headache. A more elegant (and reuseable) solution would be to use the id, which is always 'index_html' for the to-be-excluded method. However... dtml-in expr="objectValues('DTML Method')" sort="title" dtml-if expr="id 'index_html'" td align="center"a href="dtml-absolute_url;"dtml-var title_or_id/a/td /dtml-if /dtml-in .. doesn't work. Does anyone know why? Short answer because id is not always a string you have to call it differently try untested but this is a faq: dtml-in expr="objectValues('DTML Method')" sort="title" dtml-if expr="_[id] 'index_html'" td align="center"a href="dtml-absolute_url;"dtml-var title_or_id/a/td /dtml-if /dtml-in hth Rik ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
RE: [Zope] dtml-tree advice, please
branches_expr="objectValues('Album' 'Photo') I think you mean branches_expr="objectValues(['Album','Photo']) seb ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
[Zope] fmt=structured-text seems wrongish
Not to throw stones, just trying to understand. WRT dtml-var ... fmt=... It makes sense to me to use "fmt=something" when the something is an instruction on how to format a number or how to format the time. In those cases, I'm simply saying how I want the number or time to appear. But when I say "fmt=structured-text" then I'm saying how the item is stored. Let's say that I've developed a Python product that contains description and now I've made an instance of it as myDoc. Within my site (application), I can ask that description be rendered this way... dtml-var "myDoc.description" fmt=structured-text By doing so, I'm telling Zope that whatever it finds in myDoc.description should be interpreted according to structured text rules from markup contained within myDoc.description itself. Now how does my application know that the myDoc object has structured text stored in description? Shouldn't the object itself know that? And shouldn't the fmt specification tell how myDoc.description is to be presented instead of how it is stored? For example, let's say I can choose to store description as plain text, as structured text, or as html. Regardless of how it is stored, I might want to ask for it as: fmt=raw in case I want to edit it fmt=html in case I want to send it to a browser and so on. Here, raw and html don't describe how to interpret the contents of myDoc.description, just how to give it back. Pointers? I guess I can just fix this within my own product(s) by returning various fields in a manner something like this: Stored as STX, return as HTML return str(StructuredText.HTML(self.description)) Stored as STX, return as raw, or stored as HTML, return as HTML return self.description and so on... -- Dennis Nichols [EMAIL PROTECTED] ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] expr=id 'index_html issue
hi, as usual, if such things happen, "id" is a method. it gets called by zope if you just use dtml-var on it. So either use id() or better, look for title and if not set (dont set a title on html_index then) dont display it. Regards Tino [EMAIL PROTECTED] wrote: Okay, this is my second question for the day. Hopefully it won't be as easy as the first -- otherwise, I'll have to stick to practicing law. I'm looking for a way to list the DTML Methods in a folder -- except the index_html method. So far, I've had to do it by using this: dtml-in expr="objectValues('DTML Method')" sort="title" dtml-if expr="title 'The Title'" td align="center"a href="dtml-absolute_url;"dtml-var title_or_id/a/td /dtml-if /dtml-in This works but it is a maintenance headache. A more elegant (and reuseable) solution would be to use the id, which is always 'index_html' for the to-be-excluded method. However... dtml-in expr="objectValues('DTML Method')" sort="title" dtml-if expr="id 'index_html'" td align="center"a href="dtml-absolute_url;"dtml-var title_or_id/a/td /dtml-if /dtml-in .. doesn't work. Does anyone know why? Thanks in advance, Ron ./. ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev ) ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] dtml-tree advice, please
Seb Bacon wrote: branches_expr="objectValues('Album' 'Photo') I think you mean branches_expr="objectValues(['Album','Photo']) Ah, what's a bracket here or there? g It may be more correct? But dtml-in "objectValues('DTML Method' 'Folder')" will render as expected. Go figure! -- Tim Cook -- Cook Information Systems | Office: (901) 884-4126 8am-5pm CDT * It's easy to stop making mistakes. Just stop having ideas. * FreePM Project Coordinator http://www.freepm.org OSHCA Founding Supporter http://www.oshca.org ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
RE: [Zope] expr=id 'index_html issue
try untested but this is a faq: dtml-in expr="objectValues('DTML Method')" sort="title" dtml-if expr="_[id] 'index_html'" td align="center"a href="dtml-absolute_url;"dtml-var title_or_id/a/td /dtml-if /dtml-in that should be dtml-if expr="_['id'] 'index_html'" (quotes round id) dtml-if expr="id() 'index_html'" would also work. This is because sometimes id is a property, sometimes it's a method. The former version would work in every case; the latter only where id is a method. It's annoying, but there's talk of providing a getId() method for every object to sort this inconsistency out. seb ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] tell-a-friend product?
Well.. a few extra minutes in my day get you... http://www.zope.org/Members/BwanaZulia/tell_a_friend/index_html Enjoy. J From: [EMAIL PROTECTED] Date: Mon, 9 Oct 2000 12:18:56 -0700 To: "J. Atwood" [EMAIL PROTECTED] Subject: Re: [Zope] tell-a-friend product? Yes, exactly. On 9 Oct 2000, at 14:53, J. Atwood wrote: Sure.. http://fundraising.gotschool.com/tell_a_friend.html Is that what you want? J From: [EMAIL PROTECTED] Date: Mon, 9 Oct 2000 11:02:36 -0700 To: [EMAIL PROTECTED] Subject: [Zope] tell-a-friend product? Hi, I am still new to zope and am wondering if there is a tell-a-friend script/product/example floating around for me to look at? If not, and I made my own form with Zope (which I have not done yet), what variable would call the existing page the user was on ? Thanks in advance. --Sean ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev ) ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] tell-a-friend product?
Now this is service! Thanks a lot for the effort. --Sean On 9 Oct 2000, at 17:41, J. Atwood wrote: Well.. a few extra minutes in my day get you... http://www.zope.org/Members/BwanaZulia/tell_a_friend/index_html Enjoy. J From: [EMAIL PROTECTED] Date: Mon, 9 Oct 2000 12:18:56 -0700 To: "J. Atwood" [EMAIL PROTECTED] Subject: Re: [Zope] tell-a-friend product? Yes, exactly. On 9 Oct 2000, at 14:53, J. Atwood wrote: Sure.. http://fundraising.gotschool.com/tell_a_friend.html Is that what you want? J From: [EMAIL PROTECTED] Date: Mon, 9 Oct 2000 11:02:36 -0700 To: [EMAIL PROTECTED] Subject: [Zope] tell-a-friend product? Hi, I am still new to zope and am wondering if there is a tell-a-friend script/product/example floating around for me to look at? If not, and I made my own form with Zope (which I have not done yet), what variable would call the existing page the user was on ? Thanks in advance. --Sean ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev ) ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] overriding __str__ method?
Seb Bacon writes: ... "manage_content" to enable editing all relevant aspects Now I want a way to give the user access to this screen. I could do a new version of the folders tree view (manage_menu), but what I'd really like to do is have a button next to each of these elements ("edit this") which calls its manage_content method. The button would only appear when the user was authenticated / authorised. My problem: The only place I can think of doing this is in each object's __str__ method. Why do you want to tinker with the "__str__" method for this reason? "manage_menu" uses "dtml-tree". The tree tag provides you with sufficient flexibility to show an additional button and to make this conditional on the users roles. Dieter ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] tell-a-friend product?
Hey... no problem. I have answered a few questions in the past about form validation and since this is a good example of it and a neat little piece of code I thought it could help. Besides, there is probably some sort of good Karma in the world of programming that I will benefit from (or already have!) :) Enjoy, J From: [EMAIL PROTECTED] Date: Mon, 9 Oct 2000 15:18:41 -0700 To: "J. Atwood" [EMAIL PROTECTED], [EMAIL PROTECTED] Subject: Re: [Zope] tell-a-friend product? Now this is service! Thanks a lot for the effort. --Sean On 9 Oct 2000, at 17:41, J. Atwood wrote: Well.. a few extra minutes in my day get you... http://www.zope.org/Members/BwanaZulia/tell_a_friend/index_html Enjoy. J From: [EMAIL PROTECTED] Date: Mon, 9 Oct 2000 12:18:56 -0700 To: "J. Atwood" [EMAIL PROTECTED] Subject: Re: [Zope] tell-a-friend product? Yes, exactly. On 9 Oct 2000, at 14:53, J. Atwood wrote: Sure.. http://fundraising.gotschool.com/tell_a_friend.html Is that what you want? J From: [EMAIL PROTECTED] Date: Mon, 9 Oct 2000 11:02:36 -0700 To: [EMAIL PROTECTED] Subject: [Zope] tell-a-friend product? Hi, I am still new to zope and am wondering if there is a tell-a-friend script/product/example floating around for me to look at? If not, and I made my own form with Zope (which I have not done yet), what variable would call the existing page the user was on ? Thanks in advance. --Sean ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev ) ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] expr=id 'index_html issue
Seb Bacon wrote: try untested but this is a faq: dtml-in expr="objectValues('DTML Method')" sort="title" dtml-if expr="_[id] 'index_html'" td align="center"a href="dtml-absolute_url;"dtml-var title_or_id/a/td /dtml-if /dtml-in that should be dtml-if expr="_['id'] 'index_html'" (quotes round id) dtml-if expr="id() 'index_html'" would also work. This is because sometimes id is a property, sometimes it's a method. The former version would work in every case; the latter only where id is a method. It's annoying, but there's talk of providing a getId() method for every object to sort this inconsistency out. As far as I know, getId() is in CVS and is documented in the CVS API online help. You should be seeing it soon. -Michel ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
[Zope] What happened to the Zope IE Editor effort?
Hi! I just got reminded of the Zope Internet Explorer WYSIWYG editor. It still can be found at http://www.zope.org/Members/johanc/ZIE ... and for anybody using IE 5.x it is a very cool thing, even if it is just intended to be a basic demo. I'd like to know if anybody is still working on that thing/actively using it? As far as I remember, the project was somewhat halted because it was a parallel effort to the Mozilla-based Zope Studio. But then, Zope Studio is also not very actively worked on, and Mozilla is still not ready for prime time ... To have a "plug-in" WYSIWYG HTML editing widget for both IE and Netscape/Mozilla would be an important improvement for the content management functionality of Zope. I've seen a couple of similar tools around, and it doesn't seem to be impossible to implement this for the two main browsers (and let an automatic browser detection do the rest). Anybody interested? Joachim. ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] ZMysqlDA error, and a workaround
I'm guessing it's in db.py in ZMySQLDA, I had to do the same thing with DECMIAL as shown here, I didn't post that since I'm not sure most folks would want this behavior but you should be able to do the same with MEDIUMINT: class DB: defs={ FIELD_TYPE.CHAR: "i", FIELD_TYPE.DATE: "d", FIELD_TYPE.DATETIME: "d", FIELD_TYPE.DECIMAL: "n", FIELD_TYPE.DOUBLE: "n", FIELD_TYPE.FLOAT: "n", FIELD_TYPE.INT24: "i", FIELD_TYPE.LONG: "i", FIELD_TYPE.LONGLONG: "l", FIELD_TYPE.SHORT: "i", FIELD_TYPE.TIMESTAMP: "d", FIELD_TYPE.TINY: "i", FIELD_TYPE.YEAR: "i", } conv={ FIELD_TYPE.TINY: int, FIELD_TYPE.SHORT: int, FIELD_TYPE.LONG: int, FIELD_TYPE.FLOAT: float, FIELD_TYPE.DOUBLE: float, FIELD_TYPE.LONGLONG: long, FIELD_TYPE.INT24: int, FIELD_TYPE.DECIMAL: float, FIELD_TYPE.YEAR: int } -steve "Jon" == Jon Franz [EMAIL PROTECTED] writes: Jon This is additional info for the error mentioned in my last Jon email. If I alter the column definitions to use 'int' as Jon opposed to 'mediumint', then everything works fine! So, its Jon the 'mediumint' type that isnt mapping properly... where Jon would i fix this? Jon ___ Zope maillist Jon - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope Jon ** No cross posts or HTML encoding! ** (Related lists - Jon http://lists.zope.org/mailman/listinfo/zope-announce Jon http://lists.zope.org/mailman/listinfo/zope-dev ) ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
RE: [Zope] ZMysqlDA error, and a workaround
Wow, that looks very diffrent from my ZMySQLDA, what version are you running? I just got mine to work, I had to mod the def section in the db.py and some of the code in the MySQLmodule.c file - I want to make it available for download and whatnot, but I need to look through the setup script (since it generated the .c file, I think, or at least moded it) and make sure what I did it integrated into the source at that stage... -Original Message- From: Steve Spicklemire [mailto:[EMAIL PROTECTED]] Sent: Monday, October 09, 2000 7:00 PM To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: Re: [Zope] ZMysqlDA error, and a workaround I'm guessing it's in db.py in ZMySQLDA, I had to do the same thing with DECMIAL as shown here, I didn't post that since I'm not sure most folks would want this behavior but you should be able to do the same with MEDIUMINT: class DB: defs={ FIELD_TYPE.CHAR: "i", FIELD_TYPE.DATE: "d", FIELD_TYPE.DATETIME: "d", FIELD_TYPE.DECIMAL: "n", FIELD_TYPE.DOUBLE: "n", FIELD_TYPE.FLOAT: "n", FIELD_TYPE.INT24: "i", FIELD_TYPE.LONG: "i", FIELD_TYPE.LONGLONG: "l", FIELD_TYPE.SHORT: "i", FIELD_TYPE.TIMESTAMP: "d", FIELD_TYPE.TINY: "i", FIELD_TYPE.YEAR: "i", } conv={ FIELD_TYPE.TINY: int, FIELD_TYPE.SHORT: int, FIELD_TYPE.LONG: int, FIELD_TYPE.FLOAT: float, FIELD_TYPE.DOUBLE: float, FIELD_TYPE.LONGLONG: long, FIELD_TYPE.INT24: int, FIELD_TYPE.DECIMAL: float, FIELD_TYPE.YEAR: int } -steve "Jon" == Jon Franz [EMAIL PROTECTED] writes: Jon This is additional info for the error mentioned in my last Jon email. If I alter the column definitions to use 'int' as Jon opposed to 'mediumint', then everything works fine! So, its Jon the 'mediumint' type that isnt mapping properly... where Jon would i fix this? Jon ___ Zope maillist Jon - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope Jon ** No cross posts or HTML encoding! ** (Related lists - Jon http://lists.zope.org/mailman/listinfo/zope-announce Jon http://lists.zope.org/mailman/listinfo/zope-dev ) ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
[Zope] ZSQL Method Timings/Profiling or MySQL SQL Execution Timing Statistics
Greetings, I have a lot of past experience with tuning and timing on Oracle (quite simple), but I seem to have hit a hurdle with timing my sql statements in MySQL. Getting these timings are _incredibly_ important to finding bottlenecks in a web site's performance... Now, first, is it possible to turn on profiling for ZSQL methods? I've turned on my Zope's profiling, and I can see statistics on how many times sqlvar was called, but not specific zsql methods. Second, anyone familiar with any mysql settings that will dump a log displaying real-time sql executions and the corresponding execute time? I like to turn sql timing on, then run around the site for a while, send some people to test it out, or throw up a http load tester script up, and then check the timing logs to see how things worked out. Regards, Knight [EMAIL PROTECTED] ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
RE: [Zope] ZMysqlDA error, and a workaround
doh, I was the one running the odd version - 1.1.3 as opposed to the newer 1.2 - I guess I never updated this when I updated the full zope install. The new version looks like it would of been much easier to fix, if it had the problem in the first place! -Original Message- From: Jon Franz Sent: Monday, October 09, 2000 7:07 PM To: '[EMAIL PROTECTED]'; Jon Franz Cc: [EMAIL PROTECTED] Subject: RE: [Zope] ZMysqlDA error, and a workaround Wow, that looks very diffrent from my ZMySQLDA, what version are you running? I just got mine to work, I had to mod the def section in the db.py and some of the code in the MySQLmodule.c file - I want to make it available for download and whatnot, but I need to look through the setup script (since it generated the .c file, I think, or at least moded it) and make sure what I did it integrated into the source at that stage... -Original Message- From: Steve Spicklemire [mailto:[EMAIL PROTECTED]] Sent: Monday, October 09, 2000 7:00 PM To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: Re: [Zope] ZMysqlDA error, and a workaround I'm guessing it's in db.py in ZMySQLDA, I had to do the same thing with DECMIAL as shown here, I didn't post that since I'm not sure most folks would want this behavior but you should be able to do the same with MEDIUMINT: class DB: defs={ FIELD_TYPE.CHAR: "i", FIELD_TYPE.DATE: "d", FIELD_TYPE.DATETIME: "d", FIELD_TYPE.DECIMAL: "n", FIELD_TYPE.DOUBLE: "n", FIELD_TYPE.FLOAT: "n", FIELD_TYPE.INT24: "i", FIELD_TYPE.LONG: "i", FIELD_TYPE.LONGLONG: "l", FIELD_TYPE.SHORT: "i", FIELD_TYPE.TIMESTAMP: "d", FIELD_TYPE.TINY: "i", FIELD_TYPE.YEAR: "i", } conv={ FIELD_TYPE.TINY: int, FIELD_TYPE.SHORT: int, FIELD_TYPE.LONG: int, FIELD_TYPE.FLOAT: float, FIELD_TYPE.DOUBLE: float, FIELD_TYPE.LONGLONG: long, FIELD_TYPE.INT24: int, FIELD_TYPE.DECIMAL: float, FIELD_TYPE.YEAR: int } -steve "Jon" == Jon Franz [EMAIL PROTECTED] writes: Jon This is additional info for the error mentioned in my last Jon email. If I alter the column definitions to use 'int' as Jon opposed to 'mediumint', then everything works fine! So, its Jon the 'mediumint' type that isnt mapping properly... where Jon would i fix this? Jon ___ Zope maillist Jon - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope Jon ** No cross posts or HTML encoding! ** (Related lists - Jon http://lists.zope.org/mailman/listinfo/zope-announce Jon http://lists.zope.org/mailman/listinfo/zope-dev ) ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Odd SQL errors- HELP
+---[ Jon Franz ]-- | | +---+--+--+-+-++ | | Field | Type | Null | Key | Default | Extra | | +---+--+--+-+-++ | | id| mediumint(8) | | PRI | 0 | auto_increment | | | value | varchar(32) | | | || | +---+--+--+-+-++ | | Now, at first i thought it was the field name of 'id' causing | the problem, but now I've tried renaming the field and its still a no-go. | I can do queries such as 'select value from reason' fine, but if i select | * or the id field, it chokes... Looking through the mailinglist archives, | I think its a 'mapping error' where the ZmySQLDA doesn't properly map | this type of field for some reason... can someone help me solve this | problem? The problem is likely to be your mediumint field, which is probably not mapped to a python type. You should let us know what version of MySQL DA you have. Also be aware that the DA is not a part of Zope, and has been contributed by a 3rd party. Anyway if you want to have a crack at fixing it, look in the ZMySQLDA directory in a file called db.py. You could add an entry with "medium int":"i" or permutations of the above. (You can test it I can't, so little point in me doing it when its this simple). -- Totally Holistic Enterprises Internet| P:+61 7 3870 0066 | Andrew Milton The Internet (Aust) Pty Ltd | F:+61 7 3870 4477 | ACN: 082 081 472 ABN: 83 082 081 472 | M:+61 416 022 411 | Carpe Daemon PO Box 837 Indooroopilly QLD 4068|[EMAIL PROTECTED]| ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] ZSQL Method Timings/Profiling or MySQL SQL ExecutionTiming Statistics
I'm answering myself because I found a solution to my problem, and I wanted to share the results with the list, in case someone is struggling to try to do the same thing... The problem with mysql (go easy, we're not talking about the fact that mysql is primitive and overall does not match up to the known transactional rdbms) is that it does not provide any sql statement profiling or timing statistics. If you use the mysql client to check a query, you can see a time. You can even write a perl script utilizing the benchmark module that comes with mysql to get more sql timings. However, neither of these methods work with Zope (i.e. do you really feel like interfacing to perl from Zope, and then calling the benchmark module for EVERY one of your queries?). A more "automated" approach is desirable, that compares to Oracle's profiling that logs ALL queries to a file with timing statistics. I finally decided after searching for a few hours for information, that I would modify Zope to handle this for me. The logical place was to put it in ZMySQLDA. I'm attaching a patch of a really _simple_ logging mechanism. The only activity that really occurs is the time is noted before and after the query gets processed and fetched, and the difference is noted. Finally, it gets logged to /tmp/mysql_timing.log --- You need to turn off MYSQL_TIMING in db.py of ZMySQL after applying the patch should you not want the timing to occur any longer. And as usual, a Zope restart is required after patching your ZMySQLDA. The patch was written for ZMySQLDA 1.2.0 (nothing below). Knight [EMAIL PROTECTED] On Mon, 9 Oct 2000, knight wrote: Greetings, I have a lot of past experience with tuning and timing on Oracle (quite simple), but I seem to have hit a hurdle with timing my sql statements in MySQL. Getting these timings are _incredibly_ important to finding bottlenecks in a web site's performance... Now, first, is it possible to turn on profiling for ZSQL methods? I've turned on my Zope's profiling, and I can see statistics on how many times sqlvar was called, but not specific zsql methods. Second, anyone familiar with any mysql settings that will dump a log displaying real-time sql executions and the corresponding execute time? I like to turn sql timing on, then run around the site for a while, send some people to test it out, or throw up a http load tester script up, and then check the timing logs to see how things worked out. Regards, Knight [EMAIL PROTECTED] ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev ) --- db.py Thu Jun 15 02:10:41 2000 +++ db.py Mon Oct 9 18:06:53 2000 @@ -142,6 +142,12 @@ def __init__(self,connection): self.connection=connection +self.MYSQL_TIMING = 1 +if self.MYSQL_TIMING: + self.timinglog = open('/tmp/mysql_timing.log', 'w+') + if not self.timinglog: +print "Error: Can't open /tmp/mysql_timing.log for writing" +self.MYSQL_TIMING = None info=split(connection) if info and len(info) 4: @@ -174,6 +180,7 @@ select_m=regex.compile('[\0- ]*select[\0- ]+', regex.casefold).match, ): +import time db=self.db try: queries=filter(None, map(strip,split(query_string, '\0'))) @@ -181,11 +188,22 @@ result=() desc=None for qs in queries: +if self.MYSQL_TIMING: + start_time = time.time() db.query(qs) + c=db.store_result() try: desc=c.describe() r=c.fetch_all_rows() +if self.MYSQL_TIMING: + end_time = time.time() + tot_time = end_time - start_time + tmpstr = "SQL Statement: " + qs + "\n" + self.timinglog.write(tmpstr) + tmpstr = "Execution Time: " + str(tot_time*1000) + " +miliseconds (ms)\n\n" + self.timinglog.write(tmpstr) + self.timinglog.flush() except: r=None if not r: continue if result:
[Zope] How: /foo?var=bar equiv to /foo/bar
I am trying to get rid of those question marks in my urls since it seems to confuse the users but I am not sure really how to do that. I have heard that it can but done but so far I have not found out how it can be done. I want for the last piece of the url to be assigned to the varialbe if a valid object can not by found. I don't really have a problem if this involves python coding I just need a place to start. Thanks ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )