Re: [Zope] DTML Document size limit?
Hi Andrew, as discussed earlyer, there is no hard coded limit in the size of the files (ok, you might not go over 2GB per file) Althought its usually not nessecary to edit such big files. Use inheritance, reuseable code and part your document into smaller pieces. This is what Zope is for. Regards Tino Wildenhain Andrew Diller wrote: I can't get a DTML Document to be bigger than about 105k. Is there a size limit to a DTML Document, and if so, how big? 105k isn't that large. -andy diller ___ 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] SQL-Query works with MySQL-monitor but not with ZMySQLDA
Hi Andy, Andy Pahne wrote: Hi, there, if I use my mysq-monitor to execute the following query, everything works fine: SELECT YEAR(START_DATE) FROM EVENT; but it doesn't work via the ZMySQLDA!?! Here's the traceback: Error, exceptions.KeyError: unhandled Please try: SELECT YEAR(START_DATE) AS START_YEAR FROM EVENT in your query. (I hope MySQL supports renaming) The problem seems zope does not get a name for the calculated column. ___ 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] Traceback? Codechange!
Hi, Marcus Collins wrote: -Original Message- From: Chris Withers [mailto:[EMAIL PROTECTED]] Sent: 29 May 2000 14:01 To: Martijn Pieters Cc: Patrick J.M. Keane; [EMAIL PROTECTED] Subject: Re: [Zope] Traceback? Martijn Pieters wrote: If you switch debug mode off, tracebacks will be included in error messages as HTML comments, thus rendering them invisible from the unsuspecting site visitor. Is that true even if you override standard_error_message? I believe so, and empiracally this appears to be the case. From HTTPResponse.py: def _traceback(self,t,v,tb): tb=self.format_exception(t,v,tb,200) tb=join(tb,'\n') tb=self.quoteHTML(tb) if self.debug_mode: _tbopen, _tbclose = 'PRE', '/PRE' else: _tbopen, _tbclose = '!--', '--' return "\n%s\n%s\n%s" % (_tbopen, tb, _tbclose) which is appended to the body of the error message when an exception occurs. This is very ugly imho. It schould be sufficient, if one includes the traceback-variable into the standard-error where its appropriate. In the current implementation it will break the HTML-standard with code outside HTML/HTML and additionally makes it impossible to get error-messages to picky browsers, such as WAP-devices. Is it ok if we remove these lines? Do I have to copy this message to the collector and wait for a couple of months or can we do it instantly? ;-) Regards Tino Wildenhain ___ 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] zodbc performance question
Hi Julio, we tested exactly this approach but run into some deadlock-situations. Since it did not improve performance we now use only one connection-object per database. Regards Tino Wildenhain julio dinis wrote: Hi all, Using zodbc, supose we have the following situation. One zodbc_database_connection and lots of zsql methods. Can we say that creating more zodbc_database_connection(with a system dsn for each one, but all pointing to the same database) and thus distribute the zsql methods avoiding to all use the same zodbc_connection, will increase performance. Dont tell me I have to test it, I will but some thougts here will help. Best regards, Júlio Dinis Silva Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.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] Extended characterset
Hi Ivan, you may want to try out the modifier url_quote eg: dtml-var arbitrary_greek_text url_quote HTH Tino Wildenhain Ivan Mackintosh wrote: Hi, What I want to do is to allow users to be able to enter greek/mathematical symbols into a textbox. I have managed to do this but get the following problem - In the first dtml method the user clicks on a symbol button and that symbol is entered into the textbox. They then click on a submit button and the next dtml method is displayed. This method simply does a dtml-var REQUEST so that I can see the value of the previous textbox. The symbol has changed! On the first method I enter a lower case delta symbol and in the second I can see an 'a' with dots above it. If I change my code so that instead of inserting a symbol into the textbox it inserts the code delta; then when I get to the second dtml method the correct symbol is displayed. This is not very user friendly though. Is there somekind of encoding variable set in Zope? as if I do the same code in straight html then it works fine. Regards, Ivan ___ 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] zodbc performance question
Francisco José Esteban Risueño wrote: I think Zope creates itself a pool of connections to the database, extending it when he need more performance. In our installation, we see initially seven connection to Oracle (trough ODBC) generated by only one zodbc database conection object Yes, but it uses a housekeeping to prevent deadlocks. If you use more connections in the same dtml-document it may lead into the problems. Imagine: connection1:update table connection2:select from table So connection1-object will never know there is an attempt to read from the table after the update. It will however "commit" the write when the document is fully generated. connection2-object will block therefore. HTH Tino Wildenhain ___ 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] Dynamically Picking which object to display
Hi Jason, Jason Lee wrote: I'm fairly new to Zope, so this may be a dumb question, and my vocabulary could be wrong, so please bear with me. I'm in the middle of building an e-commerce solution for my company, and we're evaluating Zope (and PHP and Servlets, but that's immaterial) as the platform on which to base this solution. That doesn't necessarily mean anything other than to give you context. One of the problems I'm facing right now is how to display a particular object based on a value. For example, let's say a user tries to access www.foo.com/MyAccount/CCInfo. If the user has authenticated, I need to show him the obviously sensitive data he has requested. If he is not authenticated, however, I need to give him a login screen which, for argument's sake, is in the DTML document Login in the root folder. How would I go about doing that? Am I making sense? Thanks... We have done it for an (closed to the public) e-commerce solution which could not be done with http-authentication (we have 2 user-names and one password for authentication for historical reasons) Se we needed a solution and found it as a simple solution with the standard header of all documents wich include some kind of session-management down the protected path. If the user is authenticated, the session management keeps track of it and provides useful data to all pages where it is included. If the session is timed out or a not authenticated user tries to access some pages, the session-management (a dtml-method) sends a redirect to the login-page. I can give a more detailed description on request. But at least: yes, you can do it; yes, it makes sense HTH Tino Wildenhain ___ 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] YA newbie question
Hi Randy, ... I figured this would be easy to do with Zope. I created a subdirectory called "modules" and put some modules into that; for example, "leftbuttons" is a dtml method containing a table data block which contains the standard left menu button HTML. I figured I could whip up a page and at the appropriate place in that page, do a 'dtml-var "modules.leftbuttons"' and have that code inserted into the page. That was my thinking. "leftbuttons" views properly by itself. However, when I try that dtml-var statment above, the page displays raw HTML. try the following: either: dtml-var "modules.leftbuttons()" or: dtml-with modules dtml-var leftbuttons /dtml-with the reason for this is: anything inside "" is a python expression, meaning it is interpreted as if you typed it into an running python-interpreter (with the zope-context around, of course). So python calls the ojects __repr__() method here to display it. For string-like objects __repr__==__str__ (with single quotes arount them) For some zope objects "self-displaying" means showing their data as source. If you use dtml-var without the quotes, zope does do some magic with the __call__() method of the object. Calling a dtml-method renders its output rather then the source. This is what is done in the first variant. NB: often you have to provide the documents context to the method, so the above call is somthing like dtml-var "modules.leftbuttons(_,_.None)" (or such like - have to look again over some documentation or the list for this) HTH Tino Wildenhain ___ 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] logout
Hi James, James Cummings wrote: Ok, since I haven't found this by searching the site or the mailing list archive, is it possible to logout as superuser? I would like to be able to login as a different user, but I haven't been able to find out how to do this. often prependig the url with the new user like this: http://newuser@site/... logs you out and in as the new user. But this behavior is not defined as in rfc. HTH Tino Wildenhain ___ 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] Re: dtml-tree with data from multiple tables
Hi Lance, Lance Kurisaki wrote: I'd like to generate a tree with data from different SQL tables depending on the tree level. In other words, the first level data comes from one table, second level comes from another. How can the branches_expr expression determine what the current tree level is? Can I pass a parameter to let me know the current level? I tried the following, but it didn't work... dtml-tree id=name branches_expr="child_lookup(_['tree-level'])" I think Anthony baxter's "Some neat tricks with dtml-tree" url: http://www.zope.org/Members/anthony/tree-coding-tricks will help you out That How-To uses the same SQL table to define children at all levels of the tree. How can I use different tables at different levels? Am I able to determine the current level in my child_lookup() method? I used a trick to archive this: each of my tables has a number as key. dtml-tree needs a unique id for lookup. So to make it unique, I add an offset to each tables key and remove it for query. My query is kind of self modifying for this, comparing if the key is inside a given interval and making the query at the appropriate table with removing the offset first and adding the next offset to the results. I can provide an example, if you wish. Regards Tino Wildenhain ___ 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] problem with PTK and LoginManager
Hi, Tim Lynch wrote: Hi, I can't seem to get PTK to install. When I put both PTKBase and PTKDemo in the Products directory, PTKBase is OK, but PTKDemo is 'broken'. The traceback is: This is already mentioned in the Install-Document on the download-page. (in short: you have to restart your zope) Regards Tino Wildenhain ___ 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] Expressing expressions
Hi RC, RC Compaan wrote: Simple addition seems a bit tricky in zope dtml-var expr="counter=counter+value" --// Here i tried to Try dtml-call "REQUEST.set('counter',counter+value)" HTH Tino Wildenhain ___ 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] Change Notification
Hi, Bob Barter wrote: Is there a way for an object to be notified that it has been modified? In particular, I want to create Relation objects that relate two arbitrary Folders. Creating the Relation object with a ZClass is easy (even for a newbie like me :-) ), but I need to update the relation links if the destination folder is moved. if it is in aqisition path, dtml-var object url may help. It would give you the URL of the object whereever it is at the moment. May be, you could use ZCatalog otherwise. HTH Tino Wildenhain ___ 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] Using Zope DB connection from a Python class
Hi Ivan, 3. Zope 2.1.7 Z ODBC DA 3.0.3 Solid dev kit 2.3 RedHat Linux 6.1 on i386 How to use Z ODBC DA on Linux? I only found a windows binary. Tino ___ 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] image inclusion: empty ALT not the same as no ALT
Hi J, J M Cerqueira Esteves wrote: Greetings I just noticed a problem with the `tag' method: If I insert an image with dtml-var "some_image.tag (border='0', alt='')" (nice because `width' and `height' are inserted automatically), I get an img element with NO `alt' attribute, instead of an `alt' atribute with an empty string as its value (alt=""). An empty `alt' value is important when using images for which it is best not to insert any alternative text in text browsers (decoration-only or redundant image links, for instance), because the absence of the `alt' attribute may not be equivalent to an empty value. In lynx, for example, the file name of the image (more precisely, the last component of the path in the `src' attribute) is shown (yuck) when no `alt' attribute is supplied. I assume the check for the attribute is only something like that: if alt: ... So an empty string is considered also false. You can work around with dtml-var "some_image.tag(border='0',alt=' ')" Since a space is not seen but also not false. HTH Tino Wildenhain ___ 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] Multiple Languages
Hi Christian, Christian Zagrodnick wrote: Hi all, has anybody figured out how to make a zope website multilingual? I have to make a website in German and English - but the database stuff etc. is all the same. Did anybody do that? somewhat. I have the code to tell what version of the page is appropriate with given browser-configuration (language-preferences) and availability. We have now to make a product to hold the different versions of documents for each language. Regards Tino Wildenhain ___ 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] Re: ZClass in ZClass problem
Oleg Broytmann wrote: Followup to myself... On Sat, 1 Jul 2000, Oleg Broytmann wrote: Then the problems begin. All management URLs for inner ZClass contain %20, so URLs look like "propertysheets/methods/RandomZItem%20/manage_workspace" and "propertysheets/methods/RandomZItem_add%20/manage_workspace". I found that not only my ZClassess do this way. I imported SiteSummary - and got the problem. Something broken in my installation? %20 is the urlencoded representation of an extraneous space at the end of your methods ids. HTH Tino Wildenhain ___ 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] Rewrite rules
Hi System Administrator wrote: Hi can any one help me with the rewrite rules ? i'm stuck. the ones on the zope documentation don't seem to be working for me . You mean for apache? These are regular expressions as in perl or module re in python. The rewrite module of Apache is documented here: http://www.apache.org/docs/mod/mod_rewrite.html We need more information of what you want to help you more. HTH Tino Wildenhain ___ 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] Lists and external methods
Hi, Oleg Broytmann wrote: On Tue, 4 Jul 2000, Pieter Claerhout wrote: I want the external method to return this in a list, where I can iterate over using the dtml-in tag, so that I can reference the different fields in each record with a name. What should the list look like so that I can accomplish this? dtml-in eats a list of objects or a list of dictionaries. I usually use the following helper-class: class generic_datarecord: " This class provides an overall mapping of value pairs " def __init__(self,**data): self.data=data def __len__(self): return(len(self.data.keys())) def __getitem__(self,key): return(self.data[key]) def __getattr__(self,key): return self.__getitem__(key) def keys(self): return(self.data.keys()) def values(self): return(self.data.values()) if you use generic_datarecord(column1=value1,coulumn2=value2) for each row, you can alterate over a list of such datarecord_objects with dtml-in using dtml-var column1 and dtml-var column2 HTH Tino Wildenhain PS: __len__() is optional, but for easy use in all circumstances (e.g. dtml-in over a single datarecord) ___ 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] How do I specify a list element?
[EMAIL PROTECTED] wrote: I have a list (I think) created this way: (date = '31-DEC-1999') dtml-call "REQUEST.set('MyList', _.string.split(date, '-'))" so now REQUEST['MyList'] should contain 3 elements: 31 DEC 1999 How, in dtml, do I say "give me the value of the 1st element of MyList" or the second or third. I've tried dtml-var "REQUEST['MyList'][0]" but I get this error: actually it is dtml-var "MyList[0]" you were pretty close :-) Tino Wildenhain ___ 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] just html, help, help, help !!!
Hi, Just some hints: think about it is really necesary to use JS here. Often it does not add comfortableness for the user. If it really brings gain in functionallyty, it schould work both ways, with and without JS. In the example below, a ular reform in the parent can be used. In a Zopish way, you would take an extra submit button (or image) to open a new part of the page to input the needed information. HTH Tino Wildenhain Marcel Preda wrote: - Original Message - From: Vincent Maton [EMAIL PROTECTED] To: Zope [EMAIL PROTECTED] Sent: Monday, July 10, 2000 11:10 AM Subject: [Zope] "just html", help, help, help !!! Hello, Can you help me ??? I have one page with a "form", in this page I have an "OnClick" who open a new page who have some informations and when I "Submit" (I think that I must use a form also in this page to send the informations to the first page), I want to receive the informations on the first page, in a input or something else ??? We are three people for find the answer but we don't find the way, this is why I call you... The key is `opener' propery of `window'object (browser must be capable JavaScript 1.1) I have tested it - just for you :) - with IE5 and NN4.61 Just a draft: The parent HTML: HTML BODY FORM NAME=aForm INPUT TYPE=TEXT VALUE="DEFAULT" /FORM A HREF="anInvalidLink" OnClick="window.open('child','childWindow');return false;"A link to a child/a /BODY /HTML The child: HTML BODY SCRIPT function setInParent(aString) { window.opener.document.forms[0].elements[0].value=aString; } /SCRIPT FORM NAME=childForm OnSubmit="setInParent(document.childForm.elements[0].value)" INPUT TYPE=TEXT VALUE="DEFAULT_CHILD" INPUT TYPE=SUBMIT /FORM /BODY /HTML PM ___ "Will I be using Python today?" and if the answer is "yes" I know that it's going to be a good day. ___ 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?
Hi, Chris Withers wrote: Hmmm, how about just sorting out the problems: dtml-var and dtml-call dtml-var "x(_,_.None,arg1=x,arg2='y',arg3=3)" html_quote should really be: dtml-var x arg1=x arg2='y' arg3=3 html_quote I want that too. When we are over it, how about replacing (or at least aliasing) these - variables to _ ? sequence-item, sequence-index etc. comes to mind. I would do it in some minutes if one wants it... Regards Tino Wildenhain ___ 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] Adding comments to documents like in ACS ...
Chris McDonough wrote: This is something I've wanted to see for a long time too. The Portal Toolkit (http://www.zope.org/Products/PTK) evidently has a "discussable" mixin class that allows users to add comments to documents. You may want to check it out. This feature should probably be abstracted out of the portal toolkit and made more generally available. I'd really like to see a "commentable document" product based on an atomic mixin class that we could reuse on Zope.org for how-tos, news items, etc. I really like ACS' "bboard" system, that's the kind of functionality I think these objects should provide. Yes. And I often wonder where my notes to sessions walk to. For the meantime, at least for docuements and methods, we can heavyly use dtml-comment Regards Tino Wildenhain ___ 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] LoadSite can create a corrupted data.fs ?
Hi Jonathan, Jonathan Desp wrote: Hi, Do you have any tools for analyse a data.fs ? (not tranalyser) I'm still getting that problem: http://lists.zope.org/pipermail/zope/2000-July/028950.html If I don't fint out why my data.fs is corrupted, I'll lost one week of work for my company. Why dont you simply restore your Data.fs from a regular backup? Regards Tino Wildenhain ___ 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] space in variable returned by queries
Vanfleteren Francois wrote: Hello, I'm working with Zope and PostgreSQL When i do a query, Zope returns me a variable with a space at the end Do you know how i can do not to have this space at the end? dtml-var "_.strip(var_with_space_at_the_end)" should do. Or dtml-call "REQUEST.set('var_without_space_at_the_end',_.strip(var_with_space))" HTH Tino Wildenhain ___ 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 crawls - the day after
"Bak @ kedai" wrote: hi all zope is faster now. i think i know why, just wanted some confirmation from the zopistas. setup: apache in front of zope on a rh 6.1 linux what happened: -got a lot of simultaneous connect in one time. whe the number of connect exceeds 200, zope started slowing down. and i mean really slow. -tried putting squid in front, still not much improvement. -set up cache headers again. i did this earlier on, but was not successful. now: -got less then 100 simultaneous connect. zope runs beautifully. what i think that solved this: -setting the cache headers. at first, i put the headers in standard_html_header, before any html documents. later, i put it after headtitle tags. and i think i can see the cache headers on. HTTP/1.1 200 OK Date: Tue, 11 Jul 2000 09:15:33 GMT Server: Apache/1.3.12 (Unix) (Red Hat/Linux) mod_fastcgi/2.2.4 (mod_pcgi2/1.0.1; PCGI/2.0a5) PHP/3.0.12 Cache-Control: must-revalidate,max-age=120 Expires: Tue, 11 Jul 2000 09:17:06 GMT X-Powered-By: Zope (www.zope.org), Python (www.python.org) Content-Length: 14508 Last-Modified: Mon, 10 Jul 2000 16:24:22 GMT Content-Type: text/html so, i guess, it does matter where you put the cache headers. is there a limit on how many simultaneous connect zope can handle? apache ( i know it's different) can handle much higher traffic with not much complaints. Uhm. Headers are headers, not content. As example, image files have headers too but no HTML inside. So you should set headers with RESPONSE.setHeader() hth Tino Wildenhain ___ 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] Case sensitivity
Hi, Ian Sparks wrote: One of my pet peeves with web servers is that : mysite.com/Members is different to : mysite.com/members (but there is no difference between MYSITE.COM and mysite.com) is there any way of making Zope case-insensitive? Most web-servers are case-sensitive. So where is the problem? You only have to type your links carefully, what is somewhat simplyer with dtml-var object url Regards Tino Wildenhain ___ 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] zeo and rdb backend
"Bak @ kedai" wrote: "Bak @ kedai" wrote: BTW, site summary doesnot work with zeo. i can vview an instance fine on the machine that server Data.fs, but not on the other machine. what should we look out for when considering zeo? boy, am i talking to myself a lot. another follow up. as always, right after i sent a distress signal to the list, i got enlightened. i missed all my external progs when i installed the other machine. so, in the hopes of not showing how dense i am ;), in conclusion -get a mirror copy of your working site - products, external methods, etc -change host for connectiing to SQL backend. use ip, not localhost Better: use hostname, not localhost-alias or ip. So you can assign this Hostname on the local machine with 127.0.0.1 and on the remote machine with the network interfaces ip-address. Just for performance... -make sure access are granted for all machines wanting to access the sql backend -to minimize error, make changes from one machine only. I have to look further, but I think a good solution for local configuration issues would be a mountable database for specific sections (like products and some folders with database-connections and such) Imagine a situation where different instances of zope, connected via zeo have to use different database-connections (odbc for windows, any other for unix). Regards Tino Wildenhain ___ 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] tree plus/minus url
Ragnar Beer wrote: I found quite an easy solution for Zope 2.1.6: In lib/python/TreeDisplay/TreeTag.py you have to replace the "old code" with the "new code". (Blame me - I forgot to make a copy beforehands which keeps me from using diff.) The idea is to "export" the piece of code that puts together the url to treeData['tree-item-clickurl'] so that you can access it with dtml-var tree-item-clickurl within your tree-tag. I haven't checked this for unwanted side effects. Perhaps someone more familiar with the zope code could do that? For me it works fine! Would you mind including an alias for tree-item-clickurl which reads tree_item_clickurl before posting it to the collector? I hope we can make all this ugly hypenation variables go away someday... Regards Tino Wildenhain _[_['sequence-item']] avoidance taskforce. ___ 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] Help!! RE:mutilple select forms and ZSQL Method
Erik Lacson wrote: We are trying to insert an values from a multiple select form into an SQL Database. Does anyone know how to handle arguments of type 'list' inside an SQL Method ? You could use dtml-in over the argument or dtml-var "_.string.join(argument),' something between the values in the statement') ... But note, there might be anything inside the variable which would not be properly sql-quotet this way. Can be very securety riscy. Regards Tino Wildenhain ___ 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] how to generate a Vcard ?
Hi, Didier Georgieff wrote: HEllo, I'm looking for providing a way to generate a vcard for desktop adressbooks. I guess someone already thought about that but i can't find anything on zope.org or mail archive. Any tip out there ? Just send your self a vcard and look at the text... (The plain message of course) HTH Tino Wildenhain ___ 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-comment doesn't?
Hi, Chris Withers wrote: Hi, Is is just me or does stuff inside a dtml-comment get parsed? So if you have: dtml-comment ... some syntactically bad dtml ... /dtml-comment You still can't save the page 'cos the the parser throws up an error. That seems silly to me. Anyone else agree? No, I disagree. Why do you want bad dtml even inside comments? dtml-comment is a tag like all the other tags. It does not control the parser. One advantage is, you may nest comment-tags. Regards Tino Wildenhain ___ 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] Changing a Z object's __class__ dynamically
hi ... I don't know what exactly is going on. My conjectures are: (1) Digicool people have re-written Python's system function setattr(), so that when it is an Z Object, the __class__ cannot be changed. (2) Caching: when I change the class of a Z Object, somehow it does not reflected in the Z Object's memory-cached version. When I remember correcly, DC's setattr does not change attributes with leading underscore in a persistence way. These attributes are considered to be local. Regards Tino Wildenhain ___ 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] tree plus/minus url
Hi, Ragnar Beer wrote: Too late, I already posted it before I went on holiday :( May be its possible to update the posting? Ragnar Ragnar Beer wrote: I found quite an easy solution for Zope 2.1.6: In lib/python/TreeDisplay/TreeTag.py you have to replace the "old code" with the "new code". (Blame me - I forgot to make a copy beforehands which keeps me from using diff.) The idea is to "export" the piece of code that puts together the url to treeData['tree-item-clickurl'] so that you can access it with dtml-var tree-item-clickurl within your tree-tag. I haven't checked this for unwanted side effects. Perhaps someone more familiar with the zope code could do that? For me it works fine! Would you mind including an alias for tree-item-clickurl which reads tree_item_clickurl before posting it to the collector? I hope we can make all this ugly hypenation variables go away someday... Regards Tino Wildenhain _[_['sequence-item']] avoidance taskforce. ___ 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] Month number as string as variable
Hi, "Williamson, Aaron" wrote: Peter, Try this bit of mojo here: dtml-let monthnr="_.DateTime().mm()" # actually, it schould be: dtml-let monthPoll="'month_%02d' % monthnr" # to produce 'month_01' to 'month_12' dtml-var monthPoll /dtml-let /dtml-let Regards Tino Wildenhain ___ 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] Microsoft SQL Server Access under Linux?
Hi Darin, Darin Lee wrote: Zopistas, Is it possible to access an ODBC data source through Zope running under Linux? I have perused the literature, and it appears the Zope DA's for ODBC only run under the Win32 environment. I would very much like to setup ZAP (for many reasons), but our "organizational standard" is MS SQL Server 6.5. It might or might not be helpful for you. I also have a bunch of databases only accessible via ODBC, so we use Merants Sequelink-Socket product (since we bought it). So far I could get mxODBC to work with it flawlessy. Now I'm up to integrate it into the ZmxODBC DA published some days ago at zope.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] Linux and ODBC
Hi Tony, Tony Corrente wrote: Hello.. I am currently using the openlink ODBC drivers to access Progress DB's on a HPUX System from A Linux Web Server using Apache and PHP4. It Works... The rest of my site has been moved to Zope. Everything I've read states that the Zope DA's for ODBC only run under the Win32... Is anyone working on this ?? or how do I do it from Linux ?? I don't want to install a N(asty)T(hing) server if I can avoid it.. This is not really true. The ZmxODBC DA cames with full sources. I was able to build most of it under linux. You have to move part of the distribution into different places. When I fully succeed ( I had plain mxODBC running already!) I will make an how-to of it. So please stay tuned ;) Regards Tino Wildenhain ___ 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] Copying a dtml method when creating a ZClass instance
Hi Kamon, kamon ayeva wrote: Hi, I need some help. I have a DTML method at the root of Zope called 'Template'. How can I make the constructor of a ZClass (folderish) to copy this method to each of its instances ? Can someone provide me with a complete snippet to add in the ZClass constructor ? Copy? Why? aquisition should make it 'visible' in every subfolder automatically. Regards Tino ___ 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] Socket.Error
Hi, Matthias Füsting wrote: The other day I have change my hostname. Today I have restart ZOPE and I get follow Error-Message: 2000-08-30T20:12:44 PROBLEM(100) ZServer Computing default hostname Traceback (innermost last): File "/opt/zope/2-1-6/z2.py", line 493, in ? logger_object=lg) File "/opt/zope/2-1-6/ZServer/medusa/http_server.py", line 560, in __init__ ip = socket.gethostbyname (socket.gethostname()) socket.error: host not found Zope does a so called double-reverse lookup to make sure one can unduptfully reresolve the hostname to its ip-address again. It asks first for the name to the ip-address. Then it asks for the ip-address to this name. The question is, where did you change the name? In DNS you have to change it in both databases. Regards Tino Wildenhain ___ 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] SQL Methods
Hi Campaan, RC Compaan wrote: I have a sql method and a dtml method calling the sql method. They live in the same folder and the dtml method's proxy roles are set. I've tried everything and Zope tells me I don't have permission to do view the sql result returned by the sql method. This worked fine in Zope 2.1.6 so I guess it has something to do with the new security model. I also have explicit ownership of all objects that I'm working with - still no luck. There was a bug in sql-methods returning subobjects without giving them the proper access rights. This was due to a change in the security mechanism on 2.2.x. The default policy is now: disallow everything as log as its not explicitely permittet. I would suggest to look for the patch on sql-methods or simply upgrade to the latest 2.2.1 where this (and much more) has already been fixed. Regards Tino Wildenhain ___ 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] Copying a dtml method when creating a ZClass instance
Hi, kamon ayeva wrote: I have several reasons whay I need to attach a template to each ZClass. Among them are: 1/ cases like high level folders where I might want to customize the page's rendering and/or skin, 2/ cases like contained objects which uses a generic skin (but you can still customize the skin of one among them, if you want) 3/ my site needs to be easily designed / modified by Web Designers that do not understand Acquisition. Ah yes. But then, you throw all the advantages of aquisition away. I would suggest to at least copy the template only on request, if changes are really made. The 'web designers' should have the opportunity to delete this template to derive their design from the previus folder. This way you would not have all the templates laying around in every subfolder and making changes very very hard. An yes, this is understandable even by the underenlighted web designer ;-) Cheers Tino ___ 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] Underscore Caracter
Hi Chris, Chris McDonough wrote: Hi Marcus, This is untested. Turn "asd asd" into "asd_asd" and output: dtml-var "_.string.join(_.string.split('asd asd'), '_')" Turn "asd_asd" into "asd asd" and output: dtml-var "_.string.join(_.string.split('asd_asd', '_'))" I've seen this on plenty lines of digicools code and wondered about if this is more efficient then using just string.replace() ? I would say string.replace() should be a bit faster. Regards Tino ___ 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] ANN: want to localize your pages and/or zope?
Hi, last night I realized my finger-trainnig called VaryTag :-) I talkt about it at EuroZope meeting in paris, but lost my old implementation during deleting of old zope instances. So it took me 3.5h to rewrite it from scratch. This time it works according to rfc2616 (HTTP/1.1). Its just one solution for serving multi language documents, but it works very well. I will soon localize the current zope with it as well as our websites will be localized. Its easy to use, just look at http://www.zope.org/Members/tino/Vary%20tag/readme/ Sorry for the ugly url with space, it was deep in the night ;-) Unfortunately zope.org has not installed the product already, so I was not able to give the readme in different languages .-)) Best regards Tino Wildenhain ___ 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] re module through the web security
Hi, Chris Withers wrote: Chris McDonough wrote: There's the perception at DC that 're' isn't appropriate for through-the-web usage because it's possible to write and use regex that sends the Python interpreter thread it's operating within into a neverending loop. Sorry. Am I the only one who thinks this is silly? One of Zope's key strengths is its granular security, right? So why isn't it the reponsibility of the site designer/maintainer/owner/whatever to ensure that only people he trusts have the ability to write DTML? It seems like that perception is hobbling Python Methods, in particular, by removing useful stuff like the re module because the assumption is being made that people editing TTW code will be untrusted. IMH(umble), either you don't have confidence in Zope's security, or you're assuming your users are stupid (that may be fair for a lot of us, but still ;-) Comments? :-) I think the granularity could be finer. If one could give some users access to more 'riscy' modules and some not, it schould be sufficient. I schould write a proposal for thru the web python products... *g* Greetings Tino ___ 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] Whitespace in lines property
Hi Tim, Tim Cook wrote: Can anyone tell me why when I edit a lines property I get leading whitespace inserted? The first line gets seven each one after that gets 10 spaces. I tried stripping it out but this didn't seem to have any effect. ... textarea name="alt_names:lines" rows="10" cols="50" dtml-in alt_names dtml-let cur_item=sequence-item ^^^ here^here dtml-var "_.string.strip(cur_item)" ^ here^here /dtml-let ^^^here ^ here /dtml-in /textarea here marks your whitespaces. try: textarea name="alt_names:lines" rows="10" cols="50" dtml-in alt_namesdtml-let cur_item=sequence-itemdtml-var "_.string.strip(cur_item)" /dtml-let/dtml-in/textarea Ugly code, but... HTH Tino ___ 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] Whitespace in lines property
Hi Tim, Tim Cook wrote: Tino Wildenhain wrote: Hi Tim, Tim Cook wrote: Can anyone tell me why when I edit a lines property I get leading whitespace inserted? The first line gets seven each one after that gets 10 spaces. I tried stripping it out but this didn't seem to have any effect. ... textarea name="alt_names:lines" rows="10" cols="50" dtml-in alt_names dtml-let cur_item=sequence-item ^^^ here^here dtml-var "_.string.strip(cur_item)" ^ here^here /dtml-let ^^^here ^ here /dtml-in /textarea here marks your whitespaces. try: textarea name="alt_names:lines" rows="10" cols="50" dtml-in alt_namesdtml-let cur_item=sequence-itemdtml-var "_.string.strip(cur_item)" /dtml-let/dtml-in/textarea Ugly code, but... Well, "realize something NEW everyday!" It never crossed my mind that the space between my code elements would be rendered. DUH! Hehe ;) I'm currently playing with a clean-up tag, to remove whitespaces/empty lines in code. May be I release it, if its fully done. Stay tuned ;-) Regards Tino ___ 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] Using Chinese Characters
Hi Kelvin, Kelvin Cheong wrote: i was wondering how i can use chinese characters with Zpe on Linux. does anyone know how? According to my "mild" research so far, i found out that Big5is a 2-byte code and is a part of ISO-10646/Unicode. It also seems to be the de-facto for traditional chinese characters. There're also Unicode CJK and GB. But GB is for China, which uses simplified chinese characters. And CJK includes both Big5 and GB. classic zope is built on python 1.52 and does not naturally support unicode. But there is a light on the horizont: http://www.zope.org/Members/htrd/wstring I have a vision of everything working together for localizing and internationalisation ;-) Regards Tino ___ 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] Import from file via management-interface
Hi all, I found it very disturbing having to get my .zexp exports into the subdirectory 'import' of the server and then using the management-interface to do the actual import. So I patched ObjectManager and the compaining dtml-file. Please check them out (included in the mail, sorry for the traffic) if I should post them to the collector. Regards Tino ## # # Zope Public License (ZPL) Version 1.0 # - # # Copyright (c) Digital Creations. All rights reserved. # # This license has been certified as Open Source(tm). # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # 1. Redistributions in source code must retain the above copyright #notice, this list of conditions, and the following disclaimer. # # 2. Redistributions in binary form must reproduce the above copyright #notice, this list of conditions, and the following disclaimer in #the documentation and/or other materials provided with the #distribution. # # 3. Digital Creations requests that attribution be given to Zope #in any manner possible. Zope includes a "Powered by Zope" #button that is installed by default. While it is not a license #violation to remove this button, it is requested that the #attribution remain. A significant investment has been put #into Zope, and this effort will continue if the Zope community #continues to grow. This is one way to assure that growth. # # 4. All advertising materials and documentation mentioning #features derived from or use of this software must display #the following acknowledgement: # # "This product includes software developed by Digital Creations # for use in the Z Object Publishing Environment # (http://www.zope.org/)." # #In the event that the product being advertised includes an #intact Zope distribution (with copyright and license included) #then this clause is waived. # # 5. Names associated with Zope or Digital Creations must not be used to #endorse or promote products derived from this software without #prior written permission from Digital Creations. # # 6. Modified redistributions of any form whatsoever must retain #the following acknowledgment: # # "This product includes software developed by Digital Creations # for use in the Z Object Publishing Environment # (http://www.zope.org/)." # #Intact (re-)distributions of any official Zope release do not #require an external acknowledgement. # # 7. Modifications are encouraged but must be packaged separately as #patches to official Zope releases. Distributions that do not #clearly separate the patches from the original work must be clearly #labeled as unofficial distributions. Modifications which do not #carry the name Zope may be packaged in any form, as long as they #conform to all of the clauses above. # # # Disclaimer # # THIS SOFTWARE IS PROVIDED BY DIGITAL CREATIONS ``AS IS'' AND ANY # EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR # PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL DIGITAL CREATIONS OR ITS # CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF # USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND # ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, # OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT # OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF # SUCH DAMAGE. # # # This software consists of contributions made by Digital Creations and # many individuals on behalf of Digital Creations. Specific # attributions are listed in the accompanying credits file. # ## __doc__="""Object Manager $Id: ObjectManager.py,v 1.98.8.7 2000/08/17 20:20:01 shane Exp $""" __version__='$Revision: 1.98.8.7 $'[11:-2] import App.Management, Acquisition, Globals, CopySupport, Products import os, App.FactoryDispatcher, ts_regex, Products from OFS.Traversable import Traversable from Globals import HTMLFile, HTMLFile, Persistent from Globals import MessageDialog, default__class_init__ from webdav.NullResource import NullResource from webdav.Collection import Collection from Acquisition import aq_base from urllib import quote from cStringIO import StringIO import marshal import App.Common from AccessControl import getSecurityManager from zLOG import LOG, ERROR import sys import XMLExportImport customImporters={ XMLExportImport.magic: XMLExportImport.importXML, }
Re: [Zope] Import from file via management-interface
Hi Bill, Bill Anderson wrote: How about just the patch next time, as opposed ot the whole patched filed? Ah yes, sure. On the other hand its more convient for the windows people, without a patch at hand... regards Tino ___ 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] Import from file via management-interface
Hi Terry, Terry Kerr wrote: you can write anything destructive, whether it is an external method, a DTML Method, or basically anything. At least if the only way you can import .zexp's is from the import directory, then only people with access to the zope file structure can import stuff...that will usually be restricted to system administrators or superuser people. Hm. I dont see the point here. First you can restrict the ability to Export/Import in the users role. Second, the either the superuser has to be bothered with imports or you have to grant all the people access to the file system. This would be much lesser security as beeing able to import via web. May be I schould have a deeper look at the ownership-problem. Giving the importing user ownership over all objects (s)he imports as long it is not the superuser, schould do the trick. Regards Tino ___ 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] Import from file via management-interface
Hi, Martijn Pieters wrote: On Sat, Sep 09, 2000 at 09:39:33AM +0200, Tino Wildenhain wrote: Terry Kerr wrote: you can write anything destructive, whether it is an external method, a DTML Method, or basically anything. At least if the only way you can import .zexp's is from the import directory, then only people with access to the zope file structure can import stuff...that will usually be restricted to system administrators or superuser people. Hm. I dont see the point here. First you can restrict the ability to Export/Import in the users role. Second, the either the superuser has to be bothered with imports or you have to grant all the people access to the file system. This would be much lesser security as beeing able to import via web. May be I schould have a deeper look at the ownership-problem. Giving the importing user ownership over all objects (s)he imports as long it is not the superuser, schould do the trick. The problem is not so much ownership of the objects imported, but the type of objects that can be instanciated from a pickle (the export format wether XML or binary, consists of pickled classes). You can create _everything_ from a pickle, as long as there is a class definition for it; including a monitor client. I can open up a high port on your machine that'll let me connect to your Zope process in a python interpreter prompt. Then your server is my oister. Thats badly true, but importing of a whole bunch of objects is also often needed. IIRC does pickle only handle instance data but not class code. (although I see using of marshal in the import code which does in fact import code as oposite to pickle) Importing instance data schould not be a problem since it can only work if the user in question has access to the classes. This access is already handled by permissions. Moreover we could restrict importing via web to the superuser at all. Allowing imports from arbitrary paths will let me exploit security holes in other internet daemons on your machine to create a pickle file for import; preferably the /tmp directory as it is world writeable. Restricting imports to one directory allows you to be much more restrictive as to who can write there. You can set up restricted FTP access or even only allow scp (ssh encrypted file transfer) for trusted people to upload exports to the Zope import directory if you need to give others import rights. Uh, do you know any ssh-daemon for windows? ;-) Regards ;-) Tino ___ 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: Modification Posts to the list (was: [Zope] Import from file viamanagement-interface)management-interface)
Hi Dieter, Dieter Maurer wrote: Hi Tino (and other potential patch posters), if possibly, you should not post complete source modules to the list. Instead, you should use either context or uniform differences to the source. Such a difference file is called a patch. Yes. I know that ;-) (Beside the file size, which was really wrong to send to the list, you can of course diff the post with your version to get the changes) Regards Tino ___ 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 not starting after VaryTag install
Hi Didier, so it looks like the vary Tag may be not compliant to older ( 2.2.x) releases of Zope? I have to check this. You should probably check if you really need an ancient version of Zope ;-) I'm really wondering how the tag can cause such a behavior. Its almost an extract of the mime-tag implementation which ships with zope. Certanly you have a copy of your Data.fs before installation? Good luck Tino Didier Georgieff wrote: Hello, Just after installing VaryTag, Zope (2-1-6) restart fine, but when i try to connect to my zope adress, i got an error (traceback further). So i stopped Zope, removed the VaryTag product, and the error is still here. So, i don't have access to my manage screen to remove the VaryTag traces or anything slse. Any quick tip would help me a lot, an avoid killing myself for loosing access to my site ;-)) Thanks in advance Zope Error Zope has encountered an error while publishing this resource. ImportError Sorry, a Zope error occurred. Traceback (innermost last): File /zope/2-1-6s/lib/python/ZPublisher/Publish.py, line 214, in publish_module File /zope/2-1-6s/lib/python/ZPublisher/Publish.py, line 179, in publish File /zope/2-1-6s/lib/python/Zope/__init__.py, line 202, in zpublisher_exception_hook (Object: ApplicationDefaultPermissions) File /zope/2-1-6s/lib/python/ZPublisher/Publish.py, line 165, in publish File /zope/2-1-6s/lib/python/ZPublisher/mapply.py, line 160, in mapply (Object: index_html) File /zope/2-1-6s/lib/python/ZPublisher/Publish.py, line 102, in call_object (Object: index_html) File /zope/2-1-6s/lib/python/OFS/DTMLMethod.py, line 150, in __call__ (Object: index_html) File /zope/2-1- 6s/lib/python/DocumentTemplate/DT_String.py, line 502, in __call__ (Object: index_html) File /zope/2-1-6s/lib/python/OFS/DTMLDocument.py, line 162, in __call__ (Object: zope_powered) File /zope/2-1- 6s/lib/python/DocumentTemplate/DT_String.py, line 443, in __call__ (Object: zope_powered) File /zope/2-1- 6s/lib/python/DocumentTemplate/DT_String.py, line 381, in cook (Object: zope_powered) File /zope/2-1- 6s/lib/python/DocumentTemplate/DT_String.py, line 231, in parse (Object: zope_powered) File /zope/2-1- 6s/lib/python/DocumentTemplate/DT_Var.py, line 248, in __init__ File /zope/2-1- 6s/lib/python/DocumentTemplate/DT_Util.py, line 357, in name_param (Info: ({'': '"zope_logo.tag(BORDER=\'0\')"'}, 'var', 1, 'name')) File /zope/2-1- 6s/lib/python/DocumentTemplate/VSEval.py, line 157, in __init__ ImportError: No module named gparse ___ 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 )
[Zope] Re(2): [Zope] Zope not starting after VaryTag install
Re again, I just checked with 2.1.6 (winNT) and it worked without problems. Can anybody else confirm this? Regards Tino Didier Georgieff wrote: Hello, Just after installing VaryTag, Zope (2-1-6) restart fine, but when i try to connect to my zope adress, i got an error (traceback further). So i stopped Zope, removed the VaryTag product, and the error is still here. So, i don't have access to my manage screen to remove the VaryTag traces or anything slse. Any quick tip would help me a lot, an avoid killing myself for loosing access to my site ;-)) Thanks in advance Zope Error Zope has encountered an error while publishing this resource. ImportError Sorry, a Zope error occurred. Traceback (innermost last): File /zope/2-1-6s/lib/python/ZPublisher/Publish.py, line 214, in publish_module File /zope/2-1-6s/lib/python/ZPublisher/Publish.py, line 179, in publish File /zope/2-1-6s/lib/python/Zope/__init__.py, line 202, in zpublisher_exception_hook (Object: ApplicationDefaultPermissions) File /zope/2-1-6s/lib/python/ZPublisher/Publish.py, line 165, in publish File /zope/2-1-6s/lib/python/ZPublisher/mapply.py, line 160, in mapply (Object: index_html) File /zope/2-1-6s/lib/python/ZPublisher/Publish.py, line 102, in call_object (Object: index_html) File /zope/2-1-6s/lib/python/OFS/DTMLMethod.py, line 150, in __call__ (Object: index_html) File /zope/2-1- 6s/lib/python/DocumentTemplate/DT_String.py, line 502, in __call__ (Object: index_html) File /zope/2-1-6s/lib/python/OFS/DTMLDocument.py, line 162, in __call__ (Object: zope_powered) File /zope/2-1- 6s/lib/python/DocumentTemplate/DT_String.py, line 443, in __call__ (Object: zope_powered) File /zope/2-1- 6s/lib/python/DocumentTemplate/DT_String.py, line 381, in cook (Object: zope_powered) File /zope/2-1- 6s/lib/python/DocumentTemplate/DT_String.py, line 231, in parse (Object: zope_powered) File /zope/2-1- 6s/lib/python/DocumentTemplate/DT_Var.py, line 248, in __init__ File /zope/2-1- 6s/lib/python/DocumentTemplate/DT_Util.py, line 357, in name_param (Info: ({'': '"zope_logo.tag(BORDER=\'0\')"'}, 'var', 1, 'name')) File /zope/2-1- 6s/lib/python/DocumentTemplate/VSEval.py, line 157, in __init__ ImportError: No module named gparse ___ 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] Favorites
Hi rishi, rishi wrote: ... The following tihng is going on; they are uploading the bookmark file manualy, by exporting from IE or NS. There is a util called "ImportExportFavorites", a javascript syntax that gets the bookmarks and post them to the server. One has to have a glance at it to say more. --" javascript:window.external.ImportExportFavorites(false,'your server adress') "-- when I use this util, it will send it's data tru the http_user_agent called "favorites", is there a posible way for grabbing the data it is sending into zope ? it will send a file called 'img.fav' Depends. It would always helpful, if you make a dtml_method with just dtml-var standard_html_header dtml-var REQUEST dtml-var standard_html_footer to see whats going on. HTH Tino ___ 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] Guess Who . . .
Hi, nice :-) "Spicklemire, Jerry" wrote: . . . has a opening posted on their Web Site for a C/C++ programmer with Zope / Python experience? http://www-3.ibm.com/employment/us/empl/jofK23137.html ... Experience Required Six years work related experience they must be from a different planet ;-) Regards Tino ___ 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] HTML-Code in variables (addition)
Hi Lars, Lars Heber wrote: Sorry, I mixed something up. Normal html is no problem at all. The problem is how to use quotes or such things. Of course I get an error by typing: dtml-let text="my html text with a link to a href="http://www.yahoo.com"Yahoo!/a" I tried typing quot; instead of ", but then the "quot;" also goes into the html code on my page - thus the link is broken... Are there any possibilities to let Zope change the quot; into ", or perhaps there is another way to do it like with the \" in C. Yes, there is. Use documenttemplates for this. This is exactly what Zope is designed for :-) I.e. make an dtml-method with the text instead of trying to build it like this. Regards Tino ___ 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] Socket.error problem
Hi Ronald, "Ronald L. Chichester" wrote: I'm getting the exact same socket.error message that appeared on this list in March, 2000. (See the attached problem.txt file.) Specifically, this is the error message that I get when I start zope. The person who kindly identified the problem didn't provide a solution. I have my netstat -a results attached as netstat.txt. Could someone tell me how I can resolve this port conflict? Incidentally, I'm using Mandrake 7.1 in a fairly standard configuration. Thanks in advance, Ron ./. This is the reply that was provided to the first person who encountered this problem (and submitted it to the list): MESSAGE You have another process that is "bind" to port 98... this is the registered port for "tacnews". try "netstat -a" under the shell... - Message d'origine - De : Ulf Byskov [EMAIL PROTECTED] À : [EMAIL PROTECTED] Envoyé : lundi 13 mars 2000 11:28 Objet : [Zope] socket problem When I try to start Z Server i get the following error messages: File "/WWW/Docs/product_development/teams/AMD_framework/dev/Zope/ZServer/medusa/a syncore.py", line 205, in bind return self.socket.bind (addr) socket.error: (98, 'Address already in use') I don't use the number 98 in any address or port (http=80, ftp='' and monitor='') so what could this error be about ? tcp0 0 *:8021 *:* LISTEN I suspect this line to be the offending one. IIRC the number "98" isnt actually a port number but a error number of the socket-lib. Your zope-ftp-server probably tries to bind 8021 which is not possible. HTH Tino Wildenhain ___ 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] Can you specify user/group to run Zope as during install
Hi Yusuf, Yusuf Goolamabbas wrote: I would like to run Zope not as user 'nobody' but as something else. Is this possible somehow, also is it possible to install the Zope tree in a location other than that untarred into [something like ./configure --prefix=/usr/local/site/Zope] Regards, Yusuf You can Zope install whereever you want. For the user look in z2.py for "UID". Regards Tino ___ 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] Zope/Posgresql/RedHat Linux
Hi, "Bak @ kedai" schrieb: is a suitable combination. I have attempted to configure this combination but run into trouble compiling PoPy-1.4.1 on RedHat Postgresql - and have not been able to resolve the problems via RedHat or Mixadlive - hence my question. Regards, Chris Marshall [EMAIL PROTECTED] why not post the question. we (www.emedia.com.my) have been using rh, zope and postgresql since february this year. all in all, everything works great. we have yet to use PoPy on the production site since it involve an upgrade of postgresql. we're using zPygresSQL currently Currently testing Zope2.2.2, Python 2.0, PostGresql, PoPy with RedHat 6.x RH 7.0 isnt recommendet at the moment. The above configuration works flawlessy. There are some warnings during compilation of PoPy because of the differents to Python 1.5.2. I would not recommend to disable transactions on the DA, since it is a strenght of Postgres and Zope. I dont understand why there is such an option at the DA. Regards Tino ___ 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] CMS/publishing system
Pete Prodoehl schrieb: ...snipp... We want to deploy across 50+ sites. (Since it's open source, we'd spend our money on customization/development rather than licensing fees.) We'd prefer a browser based administration system. (Zope's already got a very good one.) Yes, its very good, but could be better. Its currently too hard wired I think. Some questions I have are: How well does Zope integrate applications/cgi's written in ASP, Cold Fusion, Perl, etc...? As we've got a number of things we'd prefer to keep as is, and run alongside Zope. Nope. You should take the chance to reimplement them. You get better performance and much cleaner solutions (better to maintain and more secure) then any of the mentioned solutions allow. Many things are better done completely different in zope. How does Zope deal with serving virtual domains off of a single NT box? What approach would that require? There are several options. One of it is site-access (product at zope.org) You can also server different instances of zope off the same server (using different ports and apache or squid in front as dispatcher) Zope looks like a really nice platform, any real-world evaluations would be most appreciated... We are currently implementing a light CMS. So stay tuned... ;) Regards Tino Wildenhain ___ 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] Patch to avoid hypenation variables and more
Hi there, finally I want to release my patch for the in-tag. I hope it finds its way into the source-tree. I was sick writing such ugly constructs as _[_['sequence-item']] and so on, so I patched DT_In.py and DT_InSV.py (in lib/python/DocumentTemplate) to use sequence_item as well. All hypenation variables have now a second representation with underscores instead of hypenation. I hope, some time we can drop these hypenation variables. The second problem is if you put one in-tag into another. You have to use dtml-let oder REQUEST.set() with variables of the outher in-tag to be able to reference them in the inner loop. The code becomes very ugly this way. So my idea was to give the in-tag an optional argument, called "prefix" to prefix all the sequence-variables with a custom identifier. So you can write: dtml-in some_sequence prefix="outer_" dtml-in some_other_sequence dtml-var outer_sequence_item:dtml-var sequence_item /dtml-in the inner sequence /dtml-in the outer sequence What do you think about this? Attached are the patch files (g-zipped) They are a bit of size, but I choosed to send them as diff, as requested to avoid flames ;) (Althought the original files would be similar in size) If someone wants the whole files, feel free to write to me) Regards Tino DT_In.py.diff.gz DT_InSV.py.diff.gz
Re: [Zope] Patch to avoid hypenation variables and more
Hi Chris, Chris Withers schrieb: Tino Wildenhain wrote: finally I want to release my patch for the in-tag. I hope it finds its way into the source-tree. Looks very cool :-) Is it in the collector yet? I've put it on the collector, but I'm not very sure I did it the right way ;-) But lets hope we can have it in the next release... Regards Tino ___ 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] How to specify to z sql methods, the connection object to use at runtime...time...
Hi Frederic, Frederic Quin schrieb: Hi all, I have the same querry to execute on different servers. I don't want to create as many z sql methods as servers I have. I would like to specify to my z sql method, the connection object to use at run time. Do I have to patch the files of z sql methods ? Can I use directly the connection object ?? A clean approach would be subclassing the zsql-method for your purpose. I would not recommend a free-form string as argument for the Datasource. May be an integer index (first, second, third... database server) or something like that? Regards Tino ___ 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] Patch to avoid hypenation variables and more
Michel Pelletier schrieb: The second problem is if you put one in-tag into another. You have to use dtml-let oder REQUEST.set() with variables of the outher in-tag to be able to reference them in the inner loop. The code becomes very ugly this way. So my idea was to give the in-tag an optional argument, called "prefix" to prefix all the sequence-variables with a custom identifier. So you can write: dtml-in some_sequence prefix="outer_" dtml-in some_other_sequence dtml-var outer_sequence_item:dtml-var sequence_item /dtml-in the inner sequence /dtml-in the outer sequence What do you think about this? It's cool. Your patches are big and therefore, naturally, are a bit worrisome to us in terms of checking them into the core. Do you have a set of test DTML scripts that verify your patch? Say, a set of scripts that verifies backwards compatibity, and a set of scripts that verifies the new functionality? I would suggest even investigating "ZUnit" and creating DTML unit tests. Then we would *really* love you. ;) Have to find this ZUnit... ;) Ok, I made some further tests and improvements. There was a mistake (ok, it comes from variables spilled randomly over DT_In.py and DT_InSV.py ;) with the prefix. In some cases it wasnt there as supposed. Now all the prefix-handling should be ok. I've made an yet simple test-suite, all available thru http://www.zope.org/Members/tino/ (See "Patch for dtml-in" there) Note: the prefix prepends only the in-tags own variables. Any attribute coming from the sequence is untouched. This is also true for statistic variables and the magic "mapping" symbol. While it could easy be implemented, I think prefixing all attributes is not such a good idea. If you are ilterating over database queries you can rename the attributes there. Regards Tino ___ 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] newbie question -- database list/report with sort bycolumn header
Hi, Chris Gray schrieb: Here's a fragment from a table that allows sorting by clicking the header in a dtml method named 'displayTable': table tr tha href="displayTable?sort_key=ID+desc"ID/a/th tha href="displayTable?sort_key=product"Product/a /tr dtml-in "SQLSelectQuery(sort_key=REQUEST['sort_key'])" Then feed sort_key into your SQLSelectQuery to use in an ORDER BY clause. select * from table order by dtml-var sort_key You schould never do so. Unquoted variables in SQL-statements are high security risc if they came from REQUEST. As an example someone can send a string which ends a statement and begins a new one, like drop table. Instead reference only an index of a list with the columns to sort. oder by dtml-sqlvar orderindex type=int is also a solution. The index ranges from 1 to number of returned values. Regards Tino You can change the properties of an object in DTML by callling its manage_changeProperties method, for example: dtml-call expr="foo.manage_changeProperties(bar='New Value')" will changes the value of foo's bar property to 'New Value'. There are several ways of getting the effect of assigning variables in DTML, but it really isn't meant to have a direct way of declaring and assigning variables. The way you're trying to use an object's properties will, I believe, cause problems in the case of simultaneous users, because it will act as a global variable. Cheers, Chris On Mon, 4 Dec 2000, John Cappelletti wrote: I am listing the results of a database query using dtml-in. I'd like to be able to give the user the option to re-sort the list by clicking on a column header. ok... I'm starting small with a form and radio buttons to allow the user to specify the sort. I've created what I believe to be a global variable for this page using the property screen. The variable is to capture the column name for the sort. My simple question is how do I assign a value to this variable inside of the dtml method! I'm not finding a description of variable assignment in the documentation (yeah, I must be missing the obvious). Any pointers would be appreciated. (also, know if anyone has implemented interactive sort by column header?) ___ 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] Random choice in dtml-in?
Hi J, "J. Atwood" schrieb: I think dtml-with "_.whrandom.choice(folder_name.objectValues())" /dtml-with should do what you want. HTH Tino Wildenhain Ok.. so I can get a random item out of a folder with. dtml-var expr="_.whrandom.choice(folder_name.objectValues())" And I can iterate through a folder with dtml-in "folder_name.objectValues()" size="1" dtml-var id, dtml-var title, dtml-var other_attribute /dtml-in But I want to include the random statement within the dtml-in so I can get more of the object values back. I know this must be some little ._."_.. or other such mix but I am getting frustrated trying. Thanks, J ___ 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] Patch to avoid hypenation variables and more
Hi again, anybody had time to test this? Chances for next zope release? Any remarks? Alternatively, btw. would be a name attribut, which defaults to "sequence". Regards Tino Tino Wildenhain schrieb: Michel Pelletier schrieb: The second problem is if you put one in-tag into another. You have to use dtml-let oder REQUEST.set() with variables of the outher in-tag to be able to reference them in the inner loop. The code becomes very ugly this way. So my idea was to give the in-tag an optional argument, called "prefix" to prefix all the sequence-variables with a custom identifier. So you can write: dtml-in some_sequence prefix="outer_" dtml-in some_other_sequence dtml-var outer_sequence_item:dtml-var sequence_item /dtml-in the inner sequence /dtml-in the outer sequence What do you think about this? It's cool. Your patches are big and therefore, naturally, are a bit worrisome to us in terms of checking them into the core. Do you have a set of test DTML scripts that verify your patch? Say, a set of scripts that verifies backwards compatibity, and a set of scripts that verifies the new functionality? I would suggest even investigating "ZUnit" and creating DTML unit tests. Then we would *really* love you. ;) Have to find this ZUnit... ;) Ok, I made some further tests and improvements. There was a mistake (ok, it comes from variables spilled randomly over DT_In.py and DT_InSV.py ;) with the prefix. In some cases it wasnt there as supposed. Now all the prefix-handling should be ok. I've made an yet simple test-suite, all available thru http://www.zope.org/Members/tino/ (See "Patch for dtml-in" there) Note: the prefix prepends only the in-tags own variables. Any attribute coming from the sequence is untouched. This is also true for statistic variables and the magic "mapping" symbol. While it could easy be implemented, I think prefixing all attributes is not such a good idea. If you are ilterating over database queries you can rename the attributes 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] Patch to avoid hypenation variables and more
Hi, anybody had time for testing? May be we could have it in the next zope release. Any comments, remarks? How about an alternatively or extra "name"-attribute wich defaults to "sequence" ? Another issue: what about an alias for dtml-var called something like: dtml-print dtml-output or dtml-out ? Just for the ones that lern zope. Since I often see the missunderstood meaning of dtml-var in such constructs like: dtml-var "somelist[dtml-var indexvar]" you know what I mean? I think it would be more obvious, if the tag would usually be called dtml-out or something. Regards Tino Tino Wildenhain schrieb: Michel Pelletier schrieb: The second problem is if you put one in-tag into another. You have to use dtml-let oder REQUEST.set() with variables of the outher in-tag to be able to reference them in the inner loop. The code becomes very ugly this way. So my idea was to give the in-tag an optional argument, called "prefix" to prefix all the sequence-variables with a custom identifier. So you can write: dtml-in some_sequence prefix="outer_" dtml-in some_other_sequence dtml-var outer_sequence_item:dtml-var sequence_item /dtml-in the inner sequence /dtml-in the outer sequence What do you think about this? It's cool. Your patches are big and therefore, naturally, are a bit worrisome to us in terms of checking them into the core. Do you have a set of test DTML scripts that verify your patch? Say, a set of scripts that verifies backwards compatibity, and a set of scripts that verifies the new functionality? I would suggest even investigating "ZUnit" and creating DTML unit tests. Then we would *really* love you. ;) Have to find this ZUnit... ;) Ok, I made some further tests and improvements. There was a mistake (ok, it comes from variables spilled randomly over DT_In.py and DT_InSV.py ;) with the prefix. In some cases it wasnt there as supposed. Now all the prefix-handling should be ok. I've made an yet simple test-suite, all available thru http://www.zope.org/Members/tino/ (See "Patch for dtml-in" there) Note: the prefix prepends only the in-tags own variables. Any attribute coming from the sequence is untouched. This is also true for statistic variables and the magic "mapping" symbol. While it could easy be implemented, I think prefixing all attributes is not such a good idea. If you are ilterating over database queries you can rename the attributes 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] More on DB Transactions
We are using ZmxODBC for a bounch of ODBC databases as well on windows as on linux. Out of the box its not very well written. If you patch it here and there, it works much faster then ZODBC-DA, that is, its multithreaded. I'm not complete happy with my patches, so I dont release them in this current state. But I will do so soon. On request, I can give what I have now. Regards Tino Wildenhain Rik Hoekstra schrieb: Paolo Quaglia wrote: Reading the [EMAIL PROTECTED] archive I found one message with an interesting sentence: [Message] I am currently considering and evaluating Zope as one of the options we have to build a really large, completely databasedriven "enterprise scale" web-platform. I am a bit worried about this "maximum of 7 threads per db This isn't a maximum. It's just the default. It's easy to increase the number of connections. [/Message] Where is this Default and How can I increase this counter?? Thanks very much in advance AFAIK the ZODBC adapter is still single threaded. See http://www.zope.org/Members/petrilli/DARoadmap for more information, though I'm not certain wether this page is still up to date. There are rumours that for SQL Server you could use the mxODBC adapter, though I know nothing more of it. Recently there were posts on this list about using the ZSybase Adapter for SQL Server they're probably thread safe as well (?). Do a search in the archives for more info ___ 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] standard_error_message woes!
Hi Chris, Chris Withers wrote: *snip* PS: almost related, have you noticed how there's no way you can prevent Zope (other than hacking the source) from tacking the error message on the end of the HTML stream, even in production mode? Not only does this produce badly formed HTML, but it gives out way more information that it should to someone potentially looking to hack your site... Where was that? I got the position in the source some time... May be we can patch it here and there to get what we all want ;-) And then put it in the collector (which currently lacks an upload facility for patches). This means including the error pages for 40x. I'm also a fan of localisated error messages as well as wap-alized ones ;) In the meantime, have a merry x-mas :-) Regards Tino PS: Chris, will you be in amsterdam? ___ 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] HTTPSConnection Python 2.3.4
Hi, Am Freitag, den 01.04.2005, 14:35 -0500 schrieb Paul Winkler: On Fri, Apr 01, 2005 at 08:29:39AM +0100, Chris Withers wrote: Paul Winkler wrote: I have a somewhat similar issue; an in-house Zope product is retrieving some information from a remote URL. If I hit the same URL from the command line on the zope server (using wget), it works fine. When Zope hits it, it gets a Bad Gateway error from the remote (Apache + Jboss) server. Will post back here with anything I find out, maybe it will help you. For both you and Jacob I'd recommend getting a packet sniffer up and running. It looks like the requests your python code is emitting are not the same as the ones that, for example, wget is emitting. It'd be a heck of a lot easier if the packets were unencrypted. I set up tcpwatch (great tool!) but predictably, for an SSL connection, the output is gibberish. Any other ideas? You might try http://www.rtfm.com/ssldump/ (also as package available for most systems) ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Set MIME type using ZPT
Am Dienstag, den 05.04.2005, 13:11 -0700 schrieb srikanth: Hi, I am using an external method to load an Image from the harddrive. The external method is as follows: from email.MIMEImage import MIMEImage ##parameters=filename def getDocument(filename): fname = '/mnt/'+filename; input = open(fname,'r') content = MIMEImage( input.read( ) ) input.close( ) return content When I try to display the content in the webpage what I actually got is all raw data of the file rather the image. So how can I convert the raw data to be dispalyed as image in the webpage. I am using ZPT to display the web page (image). If its dtml I could have used dtml-mime tag is there any equivalent to that in ZPT. This is not a domain for templating languages like DTML or ZPT. Images are read seperately by the client (get a sniffer like shanes tcpwatch or tcpflow and see whats going on there) So your external method has to set the headers. Unfortunalely you open a huge security hole with your solution and by not reading the python documentation carefully ;) fname = '/mnt/'+filename; --- if I put a filename like ../etc/passwd I start to have fun. Ah, and image data for web pages are raw. So you dont need mimeimage alltogether. Just open().read() Again, if you want performance, you should use: from ZPublisher.Iterators import filestream_iterator return filestream_iterator(filenameondisk,'rb') Regards Tino ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] how to store ZSQL query results in a python var
Am Donnerstag, den 07.04.2005, 04:10 -0700 schrieb prabuddha ray: from a newbie, i've this ZSQLmethod returning me a string only. how do i store it a var in my python script. eg., userlevel = container.getUserLevel(uname=user) when i print it using html_quote as : print (%s) % html_quote(userlevel) return printed output is : (lt;Shared.DC.ZRDB.Results.Results instance at 0x41dd966cgt;) please help. Well, ZSQL Methods always return result sets, never strings. The restult set is an object which works similar to a list with result objects, each result object having attributes which correspond to column names of your query. The result objects have a method dictionaries() which in fact return the data as regular list with dictionaries for the rows (easier to look at if you see their string representation) so what you probably want goes like this: result=container.getUserLevel(uname=user) if result: userlevel=result[0].userlevel else: userlevel=somedefault # or raise error or whatnot the if result: idiom handles the fact the query might not return any result. It is true however if you get at least one row. result[0] addresses the very first row of the result - which must exist in a non empty result set. HTH Tino ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] DTML namespace problem (was: dtml-tree issue)
Hi, Am Montag, den 11.04.2005, 14:08 +0300 schrieb Vangelis Mihalopoulos: Andreas Jung wrote: You should *not* define classes inside PythonScripts. PythonScripts are stricted and don't provide the full functionality. Either use filesystem based code (Zope Product) or use simple Python datatypes as dictionaries in this case. An External Method behaves exactly the same. I have not yet involved in writting even the simpler Product and i will not do it now for such a trivial issue. I tried to return a dictionary, - return {'a':1, 'b':2, 'c':3} -- but it the DTML Doc fails with a KeyError. Use a dict and if you really need DTML... see the keyword mapping for dtml-with and dtml-in tags. If you want to return custom class objects into untrusted code (e.g. from external methods) you need to set security declarations on them - at least add the attribute: __allow_access_to_unprotected_subobjects=1 (from top of head - just grep -r zopes source for the actual name) HTH Tino ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Subfolders of Extensions folder
Am Freitag, den 15.04.2005, 13:40 +0300 schrieb Vital Lobachevsky: Hi, all! Can I use the folders in Zope's Extensions folder to keep the External Methods in more logical way? iirc you can just create a directory in Products and put your methods there. You can then import it from here. try with or without __init__.py in that directory (can be empty) and Products.yourproduct.yourmodule as module name. ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Re: Subfolders of Extensions folder
Am Freitag, den 15.04.2005, 10:41 -0400 schrieb Tres Seaver: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Tino Wildenhain wrote: Am Freitag, den 15.04.2005, 13:40 +0300 schrieb Vital Lobachevsky: Hi, all! Can I use the folders in Zope's Extensions folder to keep the External Methods in more logical way? iirc you can just create a directory in Products and put your methods there. You can then import it from here. try with or without __init__.py in that directory (can be empty) and Products.yourproduct.yourmodule I don't think the 'Products.' prefix should be there (at least, I never use it for standard products' EMs). Yes maybe. It was untested and to be fully explorated by the reader :-) Regards Tino ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] ZPsycopgDA dropping connections?
Hi, Am Mittwoch, den 20.04.2005, 15:23 +1000 schrieb Richard Jones: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Has anyone else seen ZPsycopgDA just lose its connection? I've got two ZEO clients set up to use it, and every now and then one of them (the primary) just up and loses its connection. There doesn't appear to be any message in the log file *except* for the message saying that the connection's not active: I remember there was a thread in the mailinglist about the new version of ZPsycopgDA not automatically reconnecting after loosing connection. So instead of the previous versions you now see the fact the connections are dropped. The reason for dropping the connection in the first place often lay in the inproper configuration of a intermediate firewall (see tcp session timeout there) Regards Tino ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Charset
Am Donnerstag, den 28.04.2005, 15:48 +0200 schrieb Daniel Dekany: Thursday, April 28, 2005, 3:11:01 PM, Peter Eis wrote: [EMAIL PROTECTED] wrote: Hello the list, In Zope.conf ( ZOPE 2.7.5-final ) I changed rest-input-encoding and rest-output-encoding to send UTF-8 and then restarted the server. But in my webbrowser, the files are always received in windows-1252. Do you access zope directly or are you running behind a web server like apache? In the latter you'll have to change the default encoding in the apache config, too. Out of curiosity: How is that? I would think that Zope creates the whole HTTP response (so including the Content-Type: text/html;charset=utf-8 header). OK, mod proxy and such may change some headers in it, but the Content-Type's charset? The charset is about the HTTP response body, which is surely created inside Zope. Yes. Its entirely Zopes job. And if you are using pure Zope, you need to set the header in the publish process, e.g. with a python script or something you use for default display. Also you need to set a property manage_page_charset in zopes root to be able to use that encoding in ZMI too. This way you arent storing unicode - only utf-8 as you want to display it. Regards Tino -- Tino Wildenhain [EMAIL PROTECTED] ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Charset
Am Montag, den 02.05.2005, 09:43 +0200 schrieb [EMAIL PROTECTED]: Hello everybody, I change the file manage.dtml in ..\python\app\dtml. This is the change I've done: !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.0 Transitional//EN http://www.w3.org/TR/REC-html40/loose.dtd; html head meta http-equiv=content-type content=text/html;charset=utf-8 / titleZope on dtml-BASE0;/title Yes, thats a common problem - true HTTP-headers always override these meta headers. Unfortunately file based approach leaves you and most tools with the meta tags to transport encoding accross different file based tools. In Zope you should simply: dtml-call expr=RESPONSE.setHeader('content-type','text/html; charset=utf-8') somewhere in the header and probably skipp the meta tag (or have it at least the same content) HTH Tino ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Is it possible to extend Zopes WebDAV authentication?
Am Freitag, den 06.05.2005, 19:26 +0100 schrieb mark hellewell: On 5/6/05, Dieter Maurer [EMAIL PROTECTED] wrote: WebDAV uses basic HTTP authentication which should use whatever UserFolder you have installed. Thanks.. So, I think I should be able to modify the authentication plugin of PUF so that each time a user makes a bad login attempt (either via WebDAV or the login form) it increments the bad login counter? Sounds like a plan, anyway :) Actually, it does not. You have no such thing like a session when all you have is webdav. I dont know if many dav-clients store cookies too - it may depend on your usecase. Without cookies you dont know if a request is the first, second or third time. And just counting per user would make an excellent way to DoS. Regards Tino ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] utf-8 vs. unicode question(s)
Am Freitag, den 06.05.2005, 19:40 +0200 schrieb Jürgen Herrmann: hi out there! there's been some discussion about utf-8 vs. unicode strings on the list lately. i'd like to ask if my gained understandings are correct und thus possibly make it clear to others also. i have set my python default encoding to utf-8, i always send http responses from zope as utf-8 (by setting the header like this: tal:define=dummy python:request.RESPONSE.\ setHeader('Content-Type','text/html;; charset=utf-8') ) maybe even better to wrap your template publishing in a script - this would avoid such a moderate ugly code. so if i'd like to use unicode strings in my zope applications, it's still necessary to convert request variables to unicode by using unicode(REQUEST.foo, 'utf-8'), right? Yes, or you use :ustring and friends modifier in your forms. See: http://www.zope.org/Members/htrd/howto/unicode-zdg-changes as far as i understodd, the conversion back to utf-8 is handled automagically by zope (if the abovementioned header is set), also correct? Yes if you set the header in response and the body is of type unicode. If your body is already encoded, you need to make sure it matches whatever you set in the header. Regards Tino ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Is it possible to extend Zopes WebDAV authentication?
Am Samstag, den 07.05.2005, 12:04 -0400 schrieb Chris McDonough: Web Folders pass cookies around too, FWIW, so it's probably not strictly necessary to use http basic auth. But without using http basic auth, there is no way to log in unless you have them go to the web interface first, then launch a web folder, so maybe impractical. Well, in theory its possible if the client accepts cookie to just store the amount of wrong attempts via cookie (or id - which would be the same) and deny any password, be it even the correct one when it comes via basic auth. But I strongly believe this does not save from abuse because its just too easy to remove the cookie or just not accept it in the first place. So I'd say its not worth the work. ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] dollars-and-cents display fails
Am Freitag, den 13.05.2005, 23:42 -0700 schrieb Greg Fischer: http://dev.mysql.com/doc/mysql/en/numeric-type-overview.html That's it right there! Before 5.0.3, they were unpacked, meaning saved like a char. Now they are packed, fixed point numbers. This is screwing up the python functions for fmt. Well, I was trying to NOT redo all that code, but looks like I will have to if I want to run the new mysql. I have tons of reports using dtml and fmt. I think I'll stick with 5.0.0 for now until I have time for that. (spent it all trying to figure out where my problem was!) Though, I might just switch to Firebird if I have to do some code changing on my app anyway. It's a bit more mature than Mysql's new stuff. (considering it's still in beta) Mysql is just so easy. Maybe postgres is an option too? At least its a bit more mature and doesnt have problems with high concurrency. ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Float object not callable (newbie question)
Am Freitag, den 13.05.2005, 16:06 +0100 schrieb Paul Hendrick: hi all, I'm trying to write a simple app which takes a name, bank balance, interest rate and returns the balance once 1 years interest has been added. I'm getting the error that float object is not callable. i can't figure out where i'm going wrong :S my code is below(getDetails, showDetails,doStuff.py), thanks for any input! paul. html body form action=showDetails method=post input name=name:str NAMEbr input name=balance:float BALANCEbr input name=interestRate:float INTEREST RATEbr input type=submit value=calculate /form /body /html This seems ok. -- html body span tal:define=name request/name; balance request/balance; rate request/interestRate span tal:content=python: here.doStuff(name,balance,rate)/span /span /body /html Why this? 1) your python script can read request just fine. No need for clumsy code in ZPT 2) your code below returns a list, so all you get is the string representation of a list. Works but does not look so fine ;) -- years = 1 newBal = balance( balance*(rate*years)) You call balance as function by using (). Try your function in the interactive interpreter if unsure, e.g. balance = 5000 rate = 8 # in percent I assume? You should state that in the form years = 4 newbalance = balance * (1+rate/100.0) ** years if you output newbalance, you will see if it does what you want. if you transfer it into the python script, replace the assignments with balance = context.REQUEST.get(balance,0) rate = context.REQUEST.get(rate,0) years = context.REQUEST.get(years,0) and return newbalance at the end. (You can also skip the variable and return the result of the expression directly) I'd point the form to itself and make the output just below it. span tal:content=here/doStuff / thats all. ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Postgres stored procedures and views support in Zope
Am Mittwoch, den 18.05.2005, 00:20 -0300 schrieb David Pratt: Can someone tell me whether/how zope supports views and stored procedures with zope. Do I need any other product besides the psycopg adapter? Any links to references appreciated. There is no special support... needed. views are tables and postgres has no stored procedures but stored functions. You use them the one or the other way with select (usually) so this fits perfectly :-) Just go on :-) Regards Tino ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
RE: [Zope] How to make a ZPT-based form that calls itself? (Part II)
} for r in context.your_zsqlmethod(arg1=argument1)] You can do a lot of preparation here. next you decide which template you want to output (can depend on request state or you use the same template for all states) return context.yourtemplate(data=somedata,value=value) Where you use tal:repeat=row options/data and tal:content=options/value So you can just use path expressions all over the place since you prepare all the data in your script. Complex data structures can be passed in (nested) dictionaries. HTH Tino Wildenhain ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] how to accumulate data using ZPT
Am Freitag, den 20.05.2005, 09:52 +0100 schrieb Hugo Ramos: Yellow, What DBMS are you using??? MySQL??? If so just have a sql method do this: == SELECT COUNT( '*' ) AS total FROM yourtable == Are you sure about the ' '? looks strange. Then call the variable total where you need it! Regards hr On 5/20/05, prabuddha ray [EMAIL PROTECTED] wrote: I've this report wherein i've to print the column total iin last row. column values are from database. so far I'm a total loss. do i need to have cookies to store this total? simplest solution if you need the data anyway: a python script where you do the zsql method results=context.whateverZSQLMethod(args...) return context.yourPageTemplate(results=results,count=len(results)) and use tal:content=options/count in the template where you need count. If its a sum you need, just work over your resultset or use a separate query. Easiest to work over result set (especially if the select is costy) results=context.whateverZSQLMethod(args...) total=0 for item in results: if item.value: # this handles the case of nulls total+=item.value and use the total as argument: return context.yourPageTemplate(results=results, count=len(results), total=total) -- Tino Wildenhain [EMAIL PROTECTED] ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] how to accumulate data using ZPT
Am Freitag, den 20.05.2005, 10:36 +0100 schrieb Hugo Ramos: On 5/20/05, Tino Wildenhain [EMAIL PROTECTED] wrote: Am Freitag, den 20.05.2005, 09:52 +0100 schrieb Hugo Ramos: Yellow, What DBMS are you using??? MySQL??? If so just have a sql method do this: == SELECT COUNT( '*' ) AS total FROM yourtable == Are you sure about the ' '? looks strange. It works both ways... With or without the ' ' ! well. another reason to avoid mysql I guess ;) ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Re: how to accumulate data using ZPT
Am Freitag, den 20.05.2005, 03:54 -0700 schrieb prabuddha ray: sorry for delay, but the options you gave are ruled out. actually not all the rows in the column have the values. Which is perfectly met by the if statement. Please read _my_ post again and to the end. further the total i'm looking for will result in a very complex query that i dont want to do onsidering the no. of rows are high. I just need something like a var in my ZPT which can just sum up the values if they are present. value's prsence i'm checking using tal:condition but how to add the value repeatedly in the sum var. No, you definitively dont want that type of algorithm implement in ZPT. Thats better done in python scripts. The skeleton again in my mail. Forget about the count() for a moment. Regards Tino -- Tino Wildenhain [EMAIL PROTECTED] ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
RE: [Zope] Modifying __bases__
Am Freitag, den 20.05.2005, 13:48 -0400 schrieb Dan Pozmanter: Well, when I run it, I am able to do the following: class A: pass class B(A): pass b = B() B.__bases__ = () print B.__bases__ Not so on the version that comes with zope. (B.__bases__ will remain unchanged.) What I aim to do is have the User Object inherit from a custom class (AlienUser). Well, you can just inherit with a class from zopes extension classes. You cannot modify the class bases like this with extension classes. You can work around that like I did with the history (monkey) patch: http://www.zope.org/Members/tino/PatchHistory/view Otherwise it sounds evil and you failed to show the true motivation with your example above. Tino. PS: Votes for a true implementation in current zope instead of the monkey patch? If so, tell me. ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] SQL Database Connections
Am Freitag, den 20.05.2005, 18:28 +0200 schrieb Andreas Jung: --On Freitag, 20. Mai 2005 9:18 Uhr -0700 Jonathan Daugherty [EMAIL PROTECTED] wrote: # Depends on the underlaying DAso which one are you using? In # general a DA should reconnect automatically. I'm using the zope-psycopgda 1.1.18-1 debian package, debian testing. Try to upgrade... Well, afaic this is a problem of the upgrade ;) this feature was introduced in the recent version of the psycopgda. Maybe this can be hacked... ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Equivalent of context ZPT variable in DTML ?
Am Montag, den 23.05.2005, 00:01 +0200 schrieb KLEIN Stéphane: Hello, What is the equivalent in DTML of ZPT context variable ? Its more or less the underscore: _ _ == context this() == template (or somethimes context if its a dtmlmethod I believe) The main problem with DTML is its lax handling of the namespaces. (e.g. they are all put on a pile where it fishes for variables - and its often a surprise where it finds them ;) ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Still. Zope date datatype and TimeZone formatting problems.
Am Sonntag, den 22.05.2005, 13:01 -0500 schrieb Felipe Barousse Boue: Zopistas: I am experiencing the same problem you described by Mr. Hong Yuan in his post a few from last March. I have Zope 2.7.4, python 2.3.4 and PostgreSQL 8.0 and psycopg as DB adapter. All my dates stores in postgresql are WITHOUT timezone and my linux is set for the America/Mexico City time zone. All works fine at the OS and python level but not within Zope, it behaves as Mr. Hong Yuan describes in the post. I have noticed that Zope, when getting the data coming from postgresql (the date) always takes it to be at midnight in GMT time zone. While formatting the date for presentation, it doesn't take into account the OS TZ settings, it just assumes data (from postgresql) is at midnight in GMT and mangles it. Of course. I wonder why it should? Otoh, did you try to give the timezone you want when you select the data? If the TZ variable is set on the zope.conf file, it actually adds hours to the date (as like moving east), having first during the day having the date ok but a wrong time and, later on the day, the date goes wrong because of that timezone difference. I assume this setting is mainly for zope generated datetime objects, not something you read from a DB. If the TZ is not set in the zope.conf file it substracts hours from the date data from postgresql, effectively moving the date on day before, because it assumed midnight GMT. Doing further experiments I have noticed that when the data type passed to Zope is date (not datetime or timespamp, only date) then Zope misbehaves with the TZ, assuming it is on GMT and not taking into account the overall system (Operating system) time zone settings. Well, databases are often on a seperate host. How should zope guess in this case? If it would, I guess someone else would complaint ;) I have seen posts discussing this issue as far back as 2001. Has it been solved already ? Is it worth getting into the Zope code and trying to fix it and submit a patch ? Or its already deprecated ? or...? I believe it is still a huge bug the the Zope/Python date time handling routines, I am correct with this appreciation? Well, zopes DateTime implemenataion has some (serious) limits. But I dont think it should really be blamed for the above problems. Maybe some workarounds can be made in the psycopg driver. What btw. happens if you use mxdatetime instead of the zope builtin? Psycopg has this as configuration option. Regards Tino ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] How can I get context property in DTML ? (example)
Am Montag, den 23.05.2005, 10:37 +0200 schrieb KLEIN Stéphane: Hello, In DTML I would like to do that : I've this directory : dir1 | dir2 | dir3 dir1 has property bar=1 dir2 has property bar=2 dir3 has property bar=3 I would like a foo_html DTML Document file which display the property bar. This file is place in dir1. Exemple : When I go to dir1/foo_html = I show 1 When I go to dir1/dir2/foo_html = I show 2 When I go to dir1/dir3/foo_html = I show 3 How can I do it ? If foo_html is a DTML Method (Method, not Document!) its just: dtml-var bar (And god knows where the bar come from ;) dtml-var expr=getProperty('bar') could work too and would be more explicit. -- Tino Wildenhain [EMAIL PROTECTED] ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] UnicodeDecodeError
Am Montag, den 23.05.2005, 10:35 +0200 schrieb Joern Wallstabe: Hello, i would like to feed a zpt form with data from a python dictionary via a python script zpt snippet: textarea name=title:record:ulines rows=3 cols=65 tal:span content=python:context.printDict(here.dict)/ This is wrong anyway. Use tal:content in the textarea instead. /textarea python script prinDict: keys_ = dict.keys() keys_.sort() lines=[] for key in keys_: lines.append(u%s:%s\n %(key ,dict[key])) uni_str = u.join(lines) return uni_str.encode('utf-8') I'm always getting a UnicodeDecodeError. I' using Zope 2.7.5, CMF 1.5.1, Python 2.3.5 HTML meta tag is set to meta http-equiv=Content-Type content=text/html; charset=utf-8 CMF default_charset = utf-8 meta charset does not count btw. CMF default should, but it really depends on the real content-type header you send. Make sure its the encoding you want there (setHeader() ) And its important to watch the encoding of the strings you work with. Where does the dictionary come from? ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Re: how to accumulate data using ZPT
Am Dienstag, den 24.05.2005, 04:09 -0700 schrieb prabuddha ray: sorry, i missed the xplanaition. i think this'll explain... div tal:define= penalty python:context.getPenalty(group_code=gcode,item_code=icode); penaltylen python:test(len(penalty)==0) so not:penaltylen ensures that unit_cost is present for this row. anyway i think this worked finally : td span tal:condition=not:penaltylen span tal:define=unit_cost python:penalty[0].unit_cost; global sum python:sum+unit_cost tal:content=unit_cost/ /span tdb tal:content=sum/b/td/tr Why dont you write this as plain python code? Python Scripts are made for that. ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] DTML in Zope 2 vs Zope 3
Am Freitag, den 27.05.2005, 00:20 +0200 schrieb Jaroslav Lukesh: ... I absolutelly agree with you, it is like my words. But separation of logic and presentation could be done successfully in DTML too. ZPT, which have separation argument is not as easy to make totally This is even somewhat correct. If people had the discipline to not abuse the templating to do complicated logic. The major drawbacks of DTML are: - one namespace (with transparent layers) - confusing naming of tags, like dtml-var which really is dtml-print or something - and the extra tags for flow control, but probably the dtml fans can live with it. - peoples practice to use dtml-var foo even inside html-tags attributes, where dtml-foo; should be used. separated design as marketing says, for example see Plone - try to customize plone site to absolutelly different custom design - it is near impossible. Unfortunately Plone is still a bad example for ZPT. It is getting better but still it has a lot of code and definition in the templates. Maybe AT would be a way out. ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Receiving mails
Am Freitag, den 27.05.2005, 11:41 -0700 schrieb Varun Parange: hi, i have downloaded an SMTP server and using it i can send mails with the help of Zope MailHost however i would also like to recieve mails how do i do this. which additional products do i need to download... Maybe you reread the thread you started some days ago: [Zope] Zope MailHost Query Especially my answer: --On Freitag, 27. Mai 2005 3:15 Uhr -0700 Varun Parange [EMAIL PROTECTED] wrote: hi, how do i receive mails using Zope mailhost?? MailHost is only for *sending* but not for receiving mails. Zope is *not* an SMTP server. But there is a currently not very good documented smtp-server for zope. http://dev.legco.biz/products/smtpservice However, this is not a beginner tool. Maybe you rather try this one: http://mjablonski.zope.de/MailBoxer which works with an existing mail server and is more easy to use and debug. Regards Tino ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )