[Zope] migration issues - 2.2.4 - 2.30
Hi there, I've been developing an application on Win32 using Zope 2.2.4 and a Gadfly database. Now that I've got a working prototype I will me rebuilding my app on Zope 2.3 in Unix using a MySQL database... tomorrow. I expect the process won't be a simple job i.e. copying pasting *won't* do the trick ;-) I just have a few questions about the problems I expect to run into: 1- Python methods/scripts. In changing my python methods to python scripts will I need to make any drastic changes or will they perform just the same if I have the *exact* same content in them? 2- MySQL DBA. I'm not responsible for installing Zope or the MySQL DBA on the Unix machine but from what I understand, people have had a few problems working with MySQL DBA. What problems can I expect? 3- I would like to backup what I have done on my home machine and copy it to another windows machine at uni (that I can reference when I'm building on the Unix version). I don't have access to the Unix machine from outside uni so, apart from copying the source into text files, is there a way I can *copy* Zope's files and place them on another machine? Hmm... I expect I'll be bombarding the list with questions these coming weeks. Thanks in advance for any information/advice you can offer. - Best regards, Lee ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
[Zope] Re: Zope Inheritance with ZClasse
Hi Ernesto, The best place to ask these questsions is on the [EMAIL PROTECTED] mailinglist. More information about the mailinglists can be found at: http://www.zope.org/Resources/MailingLists/ I forwarded your mail to the list. Hope this helps! On Sun, Jan 28, 2001 at 08:14:18AM -0500, Ernesto Revilla wrote: Dear Developers of Zope, I'm trying to model an ERP system using ZClasses. As I have the model running under MS-Access, I know exactly how the model has to be. It's natural form is very, very object-oriented and requires inheritance. I made a simple example model using ZClasses, but the environment does not work how I did expect. Example: I have orders, delivery notes and invoices. Meanwhile the three are based on the same base ZClass (say OrdDelInv), orders and delivery notes are based also on a common ZClass (say OrdDel) based on OrdDelInv. Defining a General Property Sheet for each class, and designing the properties needed for each class, and defining a General view for the General Property Sheel in the base classes (OrdDel and OrdDelInv), not the bottom-level (Orders and Delivery Notes), the environment should me offer a 'General' View for each Order or Delivery Note I create. So, 1. views are not inherited, from one base class to a sub class? 2. Property Sheets do not mix up the properties defined in each class of the class hierarchy, making able to edit them all in the same view? Best regards, Erny -- Martijn Pieters | Software Engineer mailto:[EMAIL PROTECTED] | Digital Creations http://www.digicool.com/ | Creators of Zope http://www.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] sending variables/parameters via hyperlink
Dieter Maurer wrote: This should work *IF* the URL does not contain funny characters. Note that many characters are not allowed in URL's and especially "value" above must not contain blanks (as per HTML 4.x and CGI). Such values must be quoted with "url_quote_plus". Why is it so bad if values contain spaces? This is the same area as why variables supplied without a value, eg: http://server/method?paramater ...don't end up in the namespace, eg, from the above example: REQUEST['paramater']=None cheers, Chris ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
[Zope] How can a document know its own URL?
Can anyone tell me how to use DTML to get at the URL for the document being displayed? I want to display the URL of the documentbeing displayed inside of the document being displayed. Something like: b You are now viewing the following URL: dtml-var Some_DTML_var /b Similar to the dtml-var title_or_id var, but for the whole URL not just the documents name or title... I've tried looking at the mailing list archives, but it is either not there or my search criteria are not as accurate as they should... ---Brendon Grunewald 70South: The no1. source for Antarcticles.Updated daily with the latest news and views on Antarctica and other polar issues.
Re: [Zope] DTML namespace puzzle
Ron Bickers writes: I have a Python Script (sendOrder) that calls a DTML method (orderMessage) as follows: container.orderMessage(num=num, SESSION=SESSION) orderMessage contains the following: dtml-with "SESSION['info']" mapping Order Number: dtml-var num Blah blah other session variables that work fine. /dtml-with I get a KeyError on num. If I modify orderMessage to contain the following, it works: dtml-let num=num dtml-with "SESSION['info']" mapping Order Number: dtml-var num Blah blah other session variables that work fine. /dtml-with /dtml-let This seems strange to me. What am I missing? I failed to reproduce this in my Zope CVS. It is puzzling indeed! Does "SESSION['info']" has a key "num" or do you expect to access the "num" passed as parameter? In this case, it might have something to do with permissions, as Zope sometimes turns insufficient permissions into KeyError. However, I expect your "SESSION['info']" is a standard dictionary and then access should by unprotected. Dieter ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] sending variables/parameters via hyperlink
Chris Withers writes: Dieter Maurer wrote: This should work *IF* the URL does not contain funny characters. Note that many characters are not allowed in URL's and especially "value" above must not contain blanks (as per HTML 4.x and CGI). Such values must be quoted with "url_quote_plus". Why is it so bad if values contain spaces? I think, it was because in early days most CGI scripts were shell scripts. It is quite hard to pass values into shell scripts that contain blanks. Unix shells are very keen to reparse them and break them up at whitespace into a sequence of words. Anyway, when you look at the current HTTP (4.01) specification, you can read that space has to be replaced by '+'. To be precise, this is a requirement for the "application/x-www-form-urlencoded" content type. This is the same area as why variables supplied without a value, eg: http://server/method?paramater don't end up in the namespace, eg, from the above example: When I looked at "ZPublisher.cgi", I had the impression that it treats such constructs as "values" rather than "names" and associate all of them with 'None'. If I am right, then ZPublisher does not expose such items. I did not check the CGI spec to learn what is the correct behaviour. Dieter ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] where are the pages stored?
Horatio B. Bogbindero writes: btw, were does zope store the template pages and objects? i tried do look into the folders but i could not seem to find it. is there are a way of moving this document root to a different folder? Before Zope 2.3, they were in "lib/python/*/*.dtml". Since Zope 2.3, they are in "lib/python/*/dtml/". also the reason why i have so many questions is because i could not find the zope documentation set in the zope source distribution. can someone point me out the distribution so that i can read the fine manual(RTFM) instead. thanks. Click on any "Help" button in the Zope management interface. Dieter ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
[Zope] Re: Subtranscations are hacky?
Chris Withers writes: What about just putting a try: ... except AttributeError around the commit_sub call in Transaction.py? What bad effects would that have? That would probably not be a good idea as it could hide serious problems. ZCatalog has a similar "try: ... except" and in its case, many trivial bugs are hidden thereby. "hasattr(...,'commit_sub')" and "hasattr(,'abort_sub')" would be a better approach. Dieter ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
[Zope] Re: Subtranscations are hacky?
"hasattr(...,'commit_sub')" and "hasattr(,'abort_sub')" would be a better approach. I'd totally agree :-) Should I put that in the collector or do you want to? cheers, Chris ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] namespace problems
How would I do the URL redirect using an equivalent to the dtml-call "RESPONSE.redirect(URL1)" that's in the DTML Method below? context.RESPONSE.redirect(URL1) cheers, Chris ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Did I miss some major change in Z SQL Methods ?
On Thursday 25 January 2001 21:29, peter bengtson wrote: Curtis, Doing Z SQL Methods (SELECT) is really easy with DTML. When you've got a working example of it in DTML, then we can perhaps help you to convert that into Python Method code. Cheers, Peter Peter, Please, do not mistake me for a newbie. I have been developing ZOPE applications for around a year now. This time, however, I have decided to try to use Python, instead of doing the entire app in DTML. People say this is a 'Bad Thing(tm)'. The SQL Method works fine. I can easily test that with the 'Test' tab. Really, the only difference now to how I would have previously done this is that I have the python method slicing the result for me. That being said, I have tried removing that, and going to the Z SQL method directly, and it STILL doesn't work. I fear that something is getting lost in the Acquisition... Have a better one, Curtis Maloney. ___ 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] Python Methods can't construct literal dictionaries?
I'm trying to create a Python Method, using PythonMethod 0-1-7, that validates a set of form values before updating a database. I planned to return any/all errors as a dictionary keyed by the errant field name. But statements like this in my Python Method input_errors = {} input_errors['password'] = "password must not be empty" ... return input_errors result in the following error when I try to save the change to the code: Error Type: Python Method Error Error Value: Forbidden operation STORE_SUBSCR at line 3 What's up with that? I can't create dictionaries in Python Methods? I must be missing something. Is there some way around this? -- Fred Yankowski [EMAIL PROTECTED] tel: +1.630.879.1312 Principal Consultant www.OntoSys.com fax: +1.630.879.1370 OntoSys, Inc 38W242 Deerpath Rd, Batavia, IL 60510, USA ___ 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] separate zope from site products
[EMAIL PROTECTED] asked: Ok, I saw it by accident while searching for something else the other day, and now can't find the HOWTO on getting your Zope install separate from your local products, so that future Zope upgrades don't require re-installation of all your already existing products. So where can I find this document I'm looking for? Evan Simpson's excellent INSTANCE_HOME writeup: http://www.zope.org/Members/4am/instancehome -- === Tres Seaver[EMAIL PROTECTED] Digital Creations "Zope Dealers" http://www.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] DTML namespace puzzle
-Original Message- From: Dieter Maurer [mailto:[EMAIL PROTECTED]] Sent: Sunday, January 28, 2001 3:43 PM To: Ron Bickers Cc: [EMAIL PROTECTED] Subject: Re: [Zope] DTML namespace puzzle Does "SESSION['info']" has a key "num" or do you expect to access the "num" passed as parameter? In this case, it might have something to do with permissions, as Zope sometimes turns insufficient permissions into KeyError. However, I expect your "SESSION['info']" is a standard dictionary and then access should by unprotected. SESSION['info'] does not have a key "num". The only num is passed as a parameter. Did you use SQLSession to try to reproduce it, or just another mapping? Could SQLSession have something to do with it? ___ Ron Bickers Logic Etc, Inc. [EMAIL PROTECTED] ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] basic authorization triggered inside LoginManager context
Fred Yankowski [EMAIL PROTECTED] wrote: I've set up LoginManager with SQL and it's working OK, but I've run into a case where the browser pops up a basic/HTTP authentication request when I try to access a particular object inside the LoginManager-protected area. I particular, I added the following line to the index_html DTML Document (at the same level as the LoginManager acl_users folder): dtml-var "_.getattr('AUTHENTICATED_USER', '__class__')" No can do, no how, no way: attribute names beginning with "_" are absolutely verbotten in through-the-web DTML. Without this line I can access the index_html file after logging in via the LoginManager scheme as a user with the 'Members' role. But with this line I get the basic authorization popup and if I cancel that I can see the following exception in the "Zope Error" page: Traceback (innermost last): File D:\PROGRA~1\Zope225\lib\python\ZPublisher\Publish.py, line 222, in publish_module File D:\PROGRA~1\Zope225\lib\python\ZPublisher\Publish.py, line 187, in publish File D:\PROGRA~1\Zope225\lib\python\ZPublisher\Publish.py, line 171, in publish File D:\PROGRA~1\Zope225\lib\python\ZPublisher\mapply.py, line 160, in mapply (Object: index_html) File D:\PROGRA~1\Zope225\lib\python\ZPublisher\Publish.py, line 112, in call_object (Object: index_html) File D:\PROGRA~1\Zope225\lib\python\OFS\DTMLDocument.py, line 177, in __call__ (Object: index_html) File D:\PROGRA~1\Zope225\lib\python\DocumentTemplate\DT_String.py, line 528, in __call__ (Object: index_html) File D:\PROGRA~1\Zope225\lib\python\DocumentTemplate\DT_Util.py, line 337, in eval (Object: _.getattr('AUTHENTICATED_USER', '__class__')) (Info: _) File string, line 0, in ? File D:\PROGRA~1\Zope225\lib\python\DocumentTemplate\DT_Util.py, line 144, in careful_getattr Unauthorized: __class__ So it looks like attempting to access the '__class__' attribute triggered this, but I don't understand why it lead to basic authentication. If this required 'Manager' permissions, why didn't I just get some kind of "forbidden" response? You are already authenticated in LM, but don't (can't, acutally) have the role to do this operation (grep the Zope source for '_what_not_even_god_should_do'). The LM can't authenticate you for what you asked, so you bang out to Zope's default, which is to try basic auth. In this case, it is particularly pointless, as there does not exist *any* user who can execute your method. It looks like the careful_getattr() function will raise a ValidationError on any attempt to access a variable whose name starts with '_'. Fine, maybe I was being naughty. But I still don't understand why this wasn't handled using LoginManager. How can I keep Basic/HTTP authentication from running when I've got LoginManager in place? Or is there reason to want both at once? The real problem is that, at the end of the day, Zope is returning an HTTP 401 for this request, which is the only possible result (it is your browser who converts that into a dialog box) Tres. -- === Tres Seaver[EMAIL PROTECTED] Digital Creations "Zope Dealers" http://www.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] Did I miss some major change in Z SQL Methods ?
I missed the original message, but I'm trying to do something similar -- use Python Methods rather than DTML -- and I found one critical difference just today. Here's an example: I've got an SQL Method called 'select_item' that takes 'item_id' as its only input parameter. I've got a DTML Method 'form_action' that has 'item_id' in its namespace by virtue of being posted from an HTTP form. When I would invoke the SQL method from DTML I could do just dtml-call select_item and the SQL method would get the item_id from the DTML method. But when using a new 'action_script' Python Method (PythonMethod 0.1.7) I have to pass that item_id explicitly from the DTML dtml-call "action_script(item_id)" and action_script itself has to call the SQL method like so self.select_item(item_id=item_id) I don't know why the explicit parameter passing is needed in the latter case (DTML to Python Method to SQL Method) but not in the former (DTML to SQL Method). I'm sure I'm missing some trick. In fact, this aspect of Zope -- when values are passed explicitly and when not -- is a major confusion for me. (And anyone who responds about "Zen" deserves to have the size 12 boot applied.) On Mon, Jan 29, 2001 at 09:28:17AM +1100, Curtis Maloney wrote: The SQL Method works fine. I can easily test that with the 'Test' tab. Really, the only difference now to how I would have previously done this is that I have the python method slicing the result for me. That being said, I have tried removing that, and going to the Z SQL method directly, and it STILL doesn't work. -- Fred Yankowski [EMAIL PROTECTED] tel: +1.630.879.1312 Principal Consultant www.OntoSys.com fax: +1.630.879.1370 OntoSys, Inc 38W242 Deerpath Rd, Batavia, IL 60510, USA ___ 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 can a document know its own URL?
Can anyone tell me how to use DTML to get at the URL for the document being displayed? dtml-var URL Sometimes, things can be so easy ;-) Joachim. ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] where are the pages stored?
btw, were does zope store the template pages and objects? i tried do look into the folders but i could not seem to find it. is there are a way of moving this document root to a different folder? Before Zope 2.3, they were in "lib/python/*/*.dtml". Since Zope 2.3, they are in "lib/python/*/dtml/". thanks for the information. i needed the information because i plan to CVS that portion of the site. we would not be using the actual web tool for generating our pages but we will be using vi and company. hehehe. thanks. also the reason why i have so many questions is because i could not find the zope documentation set in the zope source distribution. can someone point me out the distribution so that i can read the fine manual(RTFM) instead. thanks. Click on any "Help" button in the Zope management interface. i use this already, but it is a bit lacking. anyway, i found some good documentation in http://www.zope.org/Documentation/. thanks. -- William Emmanuel S. Yu Ateneo Cervini-Eliazo Networks (ACENT) email : [EMAIL PROTECTED] web: http://cersa.admu.edu.ph/ phone : 63(2)4266001-5925/5904 ... I want FORTY-TWO TRYNEL FLOATATION SYSTEMS installed within SIX AND A HALF HOURS!!! ___ 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] namespace problems
with your line dropped in, my python script still gives me: Error Type: AttributeError Error Value: RESPONSE I'm passing variables via a form action..., how do I let python access that namespace? Thanks, Gary. Chris Withers wrote: How would I do the URL redirect using an equivalent to the dtml-call "RESPONSE.redirect(URL1)" that's in the DTML Method below? context.RESPONSE.redirect(URL1) cheers, Chris ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
[Zope] Core Session
Is core session a part 2.3? Can someone point me to the documentation on it? Thanks, josh on ___ 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] Python Methods can't construct literal dictionaries?
This is one of the shortcomings of Python Methods that Scripts eliminate. You can work around it by writing: x = {} x.update({y: z}) Cheers, Evan @ digicool 4-am ___ 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] Core Session
Hi Josh, No, the core session tracking product does not ship with 2.3. But it does work with it. You can get it from http://www.zope.org/Members/mcdonc/Products/CoreSessionTracking On Sun, 28 Jan 2001 17:19:32 -0800 "josh on" [EMAIL PROTECTED] wrote: Is core session a part 2.3? Can someone point me to the documentation on it? Thanks, josh on ___ 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] Did I miss some major change in Z SQL Methods ?
On Monday 29 January 2001 10:19, Fred Yankowski wrote: I missed the original message, but I'm trying to do something similar -- use Python Methods rather than DTML -- and I found one critical difference just today. Here's an example: I've got an SQL Method called 'select_item' that takes 'item_id' as its only input parameter. I've got a DTML Method 'form_action' that has 'item_id' in its namespace by virtue of being posted from an HTTP form. When I would invoke the SQL method from DTML I could do just dtml-call select_item and the SQL method would get the item_id from the DTML method. But when using a new 'action_script' Python Method (PythonMethod 0.1.7) I have to pass that item_id explicitly from the DTML dtml-call "action_script(item_id)" and action_script itself has to call the SQL method like so self.select_item(item_id=item_id) I don't know why the explicit parameter passing is needed in the latter case (DTML to Python Method to SQL Method) but not in the former (DTML to SQL Method). I'm sure I'm missing some trick. In fact, this aspect of Zope -- when values are passed explicitly and when not -- is a major confusion for me. (And anyone who responds about "Zen" deserves to have the size 12 boot applied.) The way it appears to work is this: DTML will pass it's namespace on implicitly. Python will not. The exact details of what are passed are somewhat of a mystery, true. Rember, of course that dtml-var "method_name()" is a Python expression. As I understand it, the equivalent of: dtml-var method_name as a Python expression is: dtml-var "method_name(_.None, _)" When it comes to Python scripts, yes, you must pass all parameters explicitly. IMHO, this is a good thing in many cases, as it forces you to make sure you are passing the correct values. But I can see how implied values could make life easier... oh well... Have a better one, Curtis Maloney P.S. I'm now moving my application to Zope 2.3 in the vague hope that PythonScripts will handle this problem better. ___ 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] subtransactions
Maybe. I wouldn't bother submitting a patch... we just need to figure out the "right thing to do". What you suggest may be it. On Sun, 28 Jan 2001 16:34:44 + Chris Withers [EMAIL PROTECTED] wrote: - Original Message - From: "Dieter Maurer" [EMAIL PROTECTED] If this is the case, then objects that do not need such hackery, simply provide empty "commit_sub" and "abort_sub" and do all their work in "commit". Chris McDonough wrote: This is about right. In that case, would putting try: .. except AttributeError's around the calls to abort_sub and commit_sub in transaction.py be a safe adn sensible thing to do? Should I submit a patch to the collector? cheers, Chris ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
[Zope] Products and Zope 2.3
On Sun, Jan 28, 2001 at 09:23:21PM -0500, Chris McDonough wrote: No, the core session tracking product does not ship with 2.3. But it does work with it. You can get it from http://www.zope.org/Members/mcdonc/Products/CoreSessionTracking This brings up the question: are there any significant products that don't yet work with Zope 2.3? David Trudgett ___ 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] Getting https://..... pages to redirect to Zope
I can't get my buy page to work on Etailer I'm not sure if it the rewrite rules in apache or the ssl setup. It seems that the https:// request doesn't get converted to call Zope When it tries to access https://192.168.0.102/Kayak/kl/buy from the browser, I get page not found. The apache error log says "File does not exist: /usr/local/httpd/htdocs/Kayak/kl/buy I can change the Document root section in the ssl virtual host, and the error remains the same (but the path changes). The accesslog says "POST /Kayak/kl/checkOut HTTP/1.1"--- this worked (http) "POST /Kayak/kl/buy HTTP/1.1" -- this didn't (https) The end of the httpd.conf file is: # RewriteLog "/var/log/httpd/rewrite_log" RewriteEngine on RewriteRule ^/static/(.*) /usr/local/httpd/htdocs/$1 [L] RewriteRule ^/cgi-bin/(.*) /usr/local/httpd/cgi-bin/$1 \ [e=HTTP_CGI_AUTHORIZATION:%1,t=application/x-httpd-cgi,L] RewriteCond %{HTTP:Authorization} ^(.*) RewriteRule ^/(.*) /usr/local/httpd/zope-cgi-bin/Zope.cgi/$1 \ [e=HTTP_CGI_AUTHORIZATION:%1,t=application/x-httpd-cgi,L] #- Interestingly when I access https://192.168.0.102/ I get the old static web pages, so I think the rewrite rule isn't hitting the https accesses. When I access http://192.168.0.102/ I get the Zope welcome screen --== Sent via Deja.com ==-- http://www.deja.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] ANNOUNCE: please have a look at ZDatabaseTool
We at easyleading.org are pleased to announce a new Zope Product. ZDatabaseTool provides a set of wizards to let you manage databases more comfortable. At the moment PostgreSQL is supported. The code is not yet released but I want you to have a look at the screen shots and the online demo. http://www.zope.org/Members/aeg/ZDatabaseTool -- Andreas Heckel [EMAIL PROTECTED] ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope-dev] Added rename to ZOPE FTP server (another bug: jpg images are not autodetected)
Joachim Werner wrote: Hi! I've found one problem with FTP and KDE: jpg-images are uploaded as files, not images. This works fine with wedav (tried cadaver) and plain command line FTP, but using KDE2 konqueror it doesn't work. Maybe because of the partial upload magic it does? Yes, I checked the code (ZClasses/Method.py, PUT_factory) and that's the reason. The Zope ftp server checks the extension when a file is created with "put", but not when it is renamed to a file with the .jpg (or other) extension. A method manage_FTPrename should be added to this file which does the same checks. Fixing this bug and the problem with identical named files in different directories in the object filesystem tree (described in my original posting) should not be very hard to fix for someone with knowledge of the object file system. I don't have that knowledge so I'll leave it to others to fix. I suggest posting both problems in the bug collector... Tom ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
[Zope-dev] How to avoid ConflictErrors ?
Hi zopers, I'm having problems with a product I'm developing. The product is part of the ZopeGUM package, the GUM product. If you have a look in gum.py in that product, you can see a method named _retrieve_messages, which can at times store enourmous amounts of objects and data in one transaction. Now, if I access the GUM instance at the same time as this method is being called, I may either get a ConflictError raised in the page, or in the Zope debug output. I've read all the posts I could find regarding ConflictErrors, and they mention that careful programming could help in avoiding these exceptions. I'm assuming that this applies only to whenever two threads are trying to *modify* the same object; and frankly, I can't see where I'm modifying any objects, unless modifying one object, an rfc822_message instance in a message_container instance also somehow modifies the message_container. Any idea what I'm doing wrong? Thanks cheers, Morten ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] How to avoid ConflictErrors ?
[Chris Withers] | Please check that both rfc822_message and message_container subclass | Persistence.Persistent. They do. *ponder* -Morten ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
[Zope-dev] Re: [Zope] Creating a namespace
Stephan Richter wrote: ...and search the list archives. The e-groups search is pointless and never gives you anything useful (I did that already). So use the ones at NIP: http://zope.nipltd.com/public/lists.html Thanks so much for your hints, but I am just a little frustrated right now (not because of you), since some of the Zope code looks like a hack. I could live without documentation, if the code would be some sort of readable. Well, maybe if you explained exactly what you're trying to do, we could be more helpful ;-) cheers, Chris ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
[Zope-dev] 2.3.0 ZCatalog Copy Paste Bug Fixed :-)
...but the error message looks better ;^)= Oh boy, Chris P's gonna kick himself for this one ;-) The idea was to change the meta_type of ZCatalog to Z Catalog so it was like everything else in core Zope, but he left a 'bad' line in ZCatalog.py. The patch below fixes the problem. *grinz* Chris --- zcatalog.py.old Fri Jan 26 14:03:24 2001 +++ zcatalog.py Sun Jan 28 20:31:50 2001 @@ -141,7 +141,6 @@ """ -meta_type = "ZCatalog" icon='misc_/ZCatalog/ZCatalog.gif' manage_options = ( ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] asynchat producer ready() method patch.
Donovan Baarda writes: I remember reading ages ago on a wishlist for ZServer that someone was thinking of adding blocking support to producers. This patch adds support for just that in a non-intrusive way. I haven't tried applying this patch to ZServer, but it _should_ work. What does "blocking support dor producers" mean? Dieter ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] ZCatalog Bug Fix II
Chris Withers wrote: Okay, tracked down what's happening, can't understand why :-( Now I can... convoluted but with a simple answer ;-) As to why the object is on the top of the namespace, I dunno whether it's dtml-in or ZCatalog that's responsible... The reason for this, was because the object was being acquired. The naming similarity was pure chance. I had an index called TestCase in the catalog, the same name as the DTML method for the form. I _didn't_ have a column called TestCase in the ZCatalog MetaData, so when the result-displaying DTML method tried to dtml-var it, it was acquired, and hence the method was plopped on top of the namespace. The actual problem is that ZCatalog was using the indexes instead of the metadata when telling Z Search was results form to build. The following patch solves that, I'm sure I put it in the collector when I moved Squishdot to use ZCatalog too :-S cheers, Chris --- zcatalog.py.old2 Sun Jan 28 20:56:06 2001 +++ zcatalog.py Sun Jan 28 21:00:09 2001 @@ -486,7 +486,7 @@ def _searchable_result_columns(self): r = [] -for name in self._catalog.indexes.keys(): +for name in self._catalog.schema.keys(): i = {} i['name'] = name i['type'] = 's' PS: I won't bother with the collector on this one, since both relevent people are already being CC'ed ;-) ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
[Zope-dev] ZDebug patch for 2.3.0
The patch below got ZDebug working with Zope 2.3.0 for me. Hope I didn't miss anything ;-) cheers, Chris --- debugsecuritypolicy.py.old Sun Jan 28 21:59:23 2001 +++ debugsecuritypolicy.py Sun Jan 28 22:07:21 2001 @@ -89,7 +89,7 @@ __version__='$Revision: 1.4 $'[11:-2] from AccessControl import SimpleObjectPolicies -_noroles=[] +_noroles=SimpleObjectPolicies._noroles from AccessControl.PermissionRole import \ _what_not_even_god_should_do, rolesForPermissionOn @@ -99,7 +99,7 @@ class DebugSecurityPolicy: def validate(self, accessed, container, name, value, context, - None=None, type=type, IntType=type(0), DictType=type({}), + roles=_noroles, None=None, type=type, IntType=type(0), DictType=type({}), getattr=getattr, _noroles=_noroles, StringType=type(''), Containers=SimpleObjectPolicies.Containers, valid_aq_=('aq_parent','aq_explicit')): @@ -116,7 +116,8 @@ # Try to get roles -roles=getattr(value, '__roles__', _noroles) +if roles is _noroles: +roles=getattr(value, '__roles__', _noroles) if roles is _noroles: @@ -174,7 +175,14 @@ value=container # Short-circuit tests if we can: -if roles is None or 'Anonymous' in roles: return 1 +try: +if roles is None or 'Anonymous' in roles: return 1 +except TypeError: +# 'roles' isn't a sequence +LOG('Zope Security Policy', PROBLEM, "'%s' passed as roles" +" during validation of '%s' is not a sequence." % ( +`roles`, name)) +raise # Check executable security stack=context.stack ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
[Zope-dev] Re: Creating a namespace
Stephan Richter [EMAIL PROTECTED] writes: I want to make my own name space with the following situation: class X: attributes = {'foo': 'bar'} x = X() Then I want to use it like that: dtml-with x dtml-var foo /dtml-with I puzzled through a related problem a little, but for (I think) a different reason. I have an External Method that takes a significant amount of time to run, and returns a collection of data. I didn't want to have to push the names of all the subvariables returned onto the stack; that pollutes the name space. What I wanted to do was the following: dtml-let x="MyExternalMethod(arg1, arg2)" Variable 1: dtml-var expr="x.variable1" br Variable 2: dtml-var expr="x.variable2" br /dtml-let (But, as in your case, I could also have done: dtml-with expr="MyExternalMethod(arg1, arg2)" Variable 1: dtml-var expr="variable1" br Variable 2: dtml-var expr="variable2" br /dtml-let ) To me, this first example seemed like a pretty common and obvious thing to to. I didn't need "x" to be persistent, I didn't need or want acqusition, I just wanted to keep my variables containerized in a structure. For this purpose, FunctionTemplate, InstanceDict, and TemplateDict all seemed either inappropriate, too complex, or too heavyweight. So, I wrote the simple container class at the end of this message that contains a grab-bag of methods that can be used for my application as well as with a variety of others that use dtml-with and dtml-in. It essentially provides all that "_.namespace()" does, plus some extra introspection. It's concocted from various pieces of Zope and the HowTos. Now, philosophical Zope questions: * To those in the know, is there any problems returning non-persistent structures? * Next, it there a reason that there's no sanctioned class for this purpose? * Can you return a populated namespace from a DTML Method or a Python Script using existing mechanisms? * Why can't you set values in "_.namespace()" in DTML after a namespace has been created? * To me, it would make so much more sense to be able create a namespace with temporary variables (as shown in one of the HowTos) rather than forcing people to hack them using REQUEST.set(). The namespace could be used directly as a structure (eg, "ns.x") or as a scope (eg, dtml-with ns dtml-var x /dtml-with ). Is there a deep reason it doesn't exist? Anyway, here's my "no-guarantee" class. Notice the magic member "__allow_access_to_unprotected_subobjects__", which the documentation (read, code) says can also be set to a list of members that you want to be publicly accessible and unprotected. Use this code as a guide; you can trim it down to get what you want. An instance of this class can be used directly as an argument to dtml-with; to use with dtml-in, use either the "getItems" or "getMap()" methods. - class StructureInstance: """A simple, non-persistent, class-based dictionary that's useful for returning arguments to Zope""" __allow_access_to_unprotected_subobjects__ = 1 def __init__(self, dict={}): self.__d=dict def __getattr__(self, name): try: return self.__d[name] except KeyError: raise AttributeError, name def __getitem__(self, name): try: return self.__d[name] except KeyError: raise KeyError, name def __setitem__(self, name, value): self.__d[name] = value def update(self, dict): self.__d.update(dict) def getKeys(self, spec=None): if spec is None: return self.__d.keys() return filter((lambda x, spec=spec: x in spec), self.__d.keys()) def getValues(self, spec=None): if spec is None: return self.__d.values() return map(lambda y: y[1], filter((lambda x, spec=spec: x[0] in spec), self.__d.keys())) def getItems(self, spec=None): if spec is None: return self.__d.items() return filter((lambda x, spec=spec: x[0] in spec), self.__d.items()) def getMap(self, spec=None): items = self.getItems(spec) dict = {} for (i, j) in items: dict[i] = j return dict def set(self, **args): self.update(args) setitem=__setitem__ --- Michael Halle [EMAIL PROTECTED] ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] Possible TransparentFolders bug?
I can't reproduce this problem myself. In fact, as of this morning it doesn't happen anymore. Guess it was just one of those flukes the universe throws at me to try to convince me to move to another universe. Shane Hathaway wrote: Itai Tavor wrote: The TransparentFolders Product seems to make everything transparent... not just transparent folders. Zope/ Folder_A/ method_A Folder_B/ (transparent folder) method_B I'd expect the only effect of the transparent folder to be that /Folder_A/method_B would work. But /method_A and /method_B also work. Tested in Zope 2.3b2 and 2.3b3 with TransparentFolders 0.3. Hmm... I can't get mine to do that. You're sure Folder_A isn't transparent also? Did you ever have a transparent folder by that name, in that same place? (Indicating a bug) Otherwise leaving things as they are, if you put a transparent folder at the root of the site, do you still get the same behavior? What path does it tell you if you visit http://yourserver:8080/method_{A|B}/manage_main? Shane -- -- Itai Tavor -- "Je sautille, donc je suis."-- [EMAIL PROTECTED]-- - Kermit the Frog -- -- -- -- "If you haven't got your health, you haven't got anything" -- ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
[Zope-dev] Unable to clear proxy roles in Zope 2.3.0
In Zope 2.2.x, one can clear the proxy roles for one method by unseleting all proxy roles. In Zope 2.3.0, this lets to this error: You must select one or more proxy roles. Is it a bug, or is it done in a different fashion? cheers Dirksen __ Do You Yahoo!? Yahoo! Auctions - Buy the things you want at great prices. http://auctions.yahoo.com/ ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
[Zope-dev] 2.3.0 release badness
I've just updated to 2.3.0 release using CVS. My CSS serving has subsequently broken. The CSS serving worked fine with the CVS code from 2.3.0b2. I didn't get to check b3 - we had a public holiday on Friday and that meant that the one working day assigned to the b3 release was lost to me (and _most_ other Australians). Anyway, that's a separate issue ... I've done a diff against the CVS as of last Tuesday, but I can't see an obvious place where the Zope code has changed to make the CSS serving fail. Under Netscape (versions 4.72 - 4.75), a 'back button' request results in a truncated plain-text display of the CSS that is linked from the page. The zope server log shows the request as being successfully served. I telnet'ed to the server and requested the CSS manually, and the headers all look fine. A packet sniffer seems to say that all is well. Now for the fun: this only happens for local requests - someone requesting the same pages over the ethernet will get them fine. Only Netscape and only locally. Konqueror locally works fine. The CSS is being served using the attached class. Some further experimentation: 1. load the same page five times as follows: http://mymachine:8080/blah/ http://127.0.0.1:8080/blah/ http://127.0.0.2:8080/blah/ http://10.0.0.20:8080/blah/ http://127.0.0.3:8080/blah/ 2. starting from either end of those URLs in the browser history, hit the 'forward' button or 'back' button four times to get to the other end. 3. note that the first hit of 'forward' or 'back' (and sometimes other hits too) the CSS is served as plain text Of course, embedding the style in the page (a-la the Zope management interface) gets around this problem, but this is not an option for us. Again, this was not a problem pre 2.3.0 b3 / release... Richard -- Richard Jones [EMAIL PROTECTED] Senior Software Developer, Bizar Software (www.bizarsoftware.com.au) CSSFile.py
Re: [Zope-dev] 2.3.0 release badness
[EMAIL PROTECTED] wrote: I've just updated to 2.3.0 release using CVS. My CSS serving has subsequently broken. The CSS serving worked fine with the CVS code from 2.3.0b2. I didn't get to check b3 - we had a public holiday on Friday and that meant that the one working day assigned to the b3 release was lost to me (and _most_ other Australians). Anyway, that's a separate issue ... (...) Under Netscape (versions 4.72 - 4.75), a 'back button' request results in a truncated plain-text display of the CSS that is linked from the page. The zope server log shows the request as being successfully served. I telnet'ed to the server and requested the CSS manually, and the headers all look fine. A packet sniffer seems to say that all is well. (...) Now for the fun: this only happens for local requests - someone requesting the same pages over the ethernet will get them fine. Only Netscape and only locally. Konqueror locally works fine. (...) Again, this was not a problem pre 2.3.0 b3 / release... Richard Hi! Nope, this is not only a problem of 2.3.0. I have had the same issue in all of the 2.3.0x Zope versions, and the problem is not really Zope but Netscape 4.X. For me, the trouble arises once in a while and specially when I start doing page reloads quickly. It seems that, when Zope starts serving the document, Netscape asks for the stylesheet file almost instantly (because it is inside the HTML's header) and then a sort of synchronizing error happens. When you are at the local machine the delay between the document requests is larger so the problem is less frequent. I have never seen the problem under Netscape 6 or Mozilla. I don't know to what extent this could be Zope's fault. Cheers! -- Pablo Bleyer Kocik | pbleyer|"Rintrah roars shakes his fires in the burdend air; @embedded.cl | Hungry clouds swag on the deep" William Blake ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] asynchat producer ready() method patch.
On Sun, Jan 28, 2001 at 09:31:07PM +0100, Dieter Maurer wrote: Donovan Baarda writes: I remember reading ages ago on a wishlist for ZServer that someone was thinking of adding blocking support to producers. This patch adds support for just that in a non-intrusive way. I haven't tried applying this patch to ZServer, but it _should_ work. What does "blocking support dor producers" mean? Disclaimer: you must be moderately familiar with ZServer/medusa/asynchat for the following to make sense; Asynchat used by ZServer and medusa use producers as a way to "push" data through an async interface. The current version of asynchat requires that producers be able to produce data immediately on calling their more() method, untill they are finished, when they return ''. My patch adds support for producers being able to "block" by letting asynchat know if they are ready via a ready() method. This allows you to use the simple producer model to push data that may not be immediately available. An example would be a http-fetch producer that fetches data from upstream for a proxy. This patch is only useful for people creating or modifying things like medusa or ZServer. -- -- ABO: finger [EMAIL PROTECTED] for more info, including pgp key -- ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] 2.3.0 release badness
the HTML's header) and then a sort of synchronizing error happens. When you are at the local machine the delay between the document requests is larger so the Oops. That should be "When you are *not* at the local machine...". Sorry ;^) -- Pablo Bleyer Kocik | pbleyer|"Rintrah roars shakes his fires in the burdend air; @embedded.cl | Hungry clouds swag on the deep" William Blake ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )