[Zope-dev] I have two question. Would you help me please.
Hello. First of all Happy New Year!This is korea. I am a zope student. On studying I have two question.Q1. How call the ZSQLMethod into script python.Firrst I write the script python named 'myscript' and the ZSQLMethod named 'mySqlMethod' myscript (script python)# Example code:# Import a standard function, and get the HTML request and response objects.from Products.PythonScripts.standard import html_quoterequest = container.REQUESTRESPONSE = request.RESPONSE # Return a string identifying this script. val = context.mySqlMethod() print valreturn printed mySqlMethod (ZSQLMethod) select * from bbs1 (:bbs1 is the table name of the DB) How call the 'mySqlMethod'(ZSQLMethod) into 'myscript'(script python) and how display the query results of ZSQL Method called into script python ?I called mysqlMethod into the above myscript( val = context.mySqlMethod()). But I failed. Q2. How to display the list type data. myDTMLMethod(DTMLMethod)** dtml-var standard_html_headerdtml-var "myScript()"dtml-var standard_html_footer myscript (script python)** # Example code:# Import a standard function, and get the HTML request and response objects.from Products.PythonScripts.standard import html_quoterequest = container.REQUESTRESPONSE = request.RESPONSE list1=[] vala = 100valb = 200 list1.append(vala)list1.append(valb) return list1 I worte DTMLMethod named 'myDTMLMethod' and script python named 'myscript'Above myscript return the list type data. Then how display the returned list type data into the myDTMLMethod?The question part is dtml-var "myScript()"But I failed.How could Iresolve thses questions?Help me!!Thank you very much. ÄÚ¸®¾Æ´Â ´ç½ÅÀ» »ç¶ûÇÕ´Ï´Ù --- ½Å³ª´Â °ÔÀÓ, ¹Ý°¡¿î Ä£±¸, ±× ¸ðµç °ÍÀÌ ÀÌ°÷¿¡! ´ëÇ¥ °ÔÀÓ ¸Þ°¡ Æ÷Å» http://game.korea.com
Re: [Zope-dev] I have two question. Would you help me please.
Hi, Q1. How call the ZSQLMethod into script python. take a look at http://www.zope.org/Members/spinwing/ZSQL_Results Q2. How to display the list type data. You should give us more info, errors or trace back. -- Vincenzo Di Somma - Responsabile Ricerca e Sviluppo - Icube S.r.l. Sede: Via Ridolfi 15 - 56124 Pisa (PI), Italia E-mail: [EMAIL PROTECTED] WWW: www.icube.it Tel:(+39) 050 97 02 07 Fax: (+39) 050 31 36 588 ___ 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] Big problem.
Urgh! While trying to get Zope 2.5.0b3 working I accidentally started a 2.5.0b3 ZEO client on a Zope 2.4.3 ZEO server. Doing this caused some stuff (Sessions?) to be added to the database. When the live 2.4.3 ZEO client stopped, it wouldn't restart with the following traceback: -- 2002-01-10T21:27:44 PANIC(300) z2 Startup exception -- 2002-01-10T21:27:44 ERROR(200) ZODB Couldn't load state for '\x00\x00\x00\x00\x00\x00\x00\x02' Traceback (innermost last): File /data/www/Zope.6/src/Zope-2.4.3-src/lib/python/ZODB/Connection.py, line 544, in setstate ImportError: No module named Sessions.SessionDataManager Traceback (innermost last): File /data/www/Zope.6/Zope/z2.py, line 564, in ? File string, line 1, in ? File /data/www/Zope.6/src/Zope-2.4.3-src/lib/python/Zope/__init__.py, line 144, in ? File /data/www/Zope.6/src/Zope-2.4.3-src/lib/python/OFS/Application.py, line 389, in initialize File /data/www/Zope.6/src/Zope-2.4.3-src/lib/python/ZODB/Connection.py, line 544, in setstate ImportError: No module named Sessions.SessionDataManager Either I need to get 2.5.0b3 working (it was dying with Error Code 11 problems) or I need to figure out how to remove the things that were added to the database by a 2.5.0b3 ZEO client. Any help or insight would be greatly appreciated. --andy. ___ 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: [ZODB-Dev] Big problem.
Could you just undo enough transactions to get back to the old state? Or do you need to keep some of the changes you made? Jeremy ___ 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: [ZODB-Dev] Big problem.
Jeremy Hylton wrote: Could you just undo enough transactions to get back to the old state? Or do you need to keep some of the changes you made? I'm not familiar with any tools that can go through transactions like this. Can you poing me towards a tool that allows me to see all the transactions and delete anything after a certain point? I don't care about what happened after the bad transaction. --andy. ___ 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] Re: [ZODB-Dev] Big problem.
Ugg. This is my fault. Get the tranalyzer (http://www.zope.org/Members/htrd/tranalyzer) Follow the instructions from Itamar's howto here: http://www.zope.org/Members/itamar/CorruptedZODB Andrew Sydelko wrote: Jeremy Hylton wrote: Could you just undo enough transactions to get back to the old state? Or do you need to keep some of the changes you made? I'm not familiar with any tools that can go through transactions like this. Can you poing me towards a tool that allows me to see all the transactions and delete anything after a certain point? I don't care about what happened after the bad transaction. --andy. ___ 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 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: [ZODB-Dev] Big problem.
I don't know if a tool exists either. I think something quick could be hacked together, but I doubt I'd have time to do it anytime soon. I don't know if you up for some programming to accomplish this goal or not. There are a couple of ideas I have along these lines in case you or someone else can pursue them. There's a tool called fstest.py in two places in CVS: Zope/utilities/ZODBTools and StandaloneZODB/Tools If you run it with a -vv argument it will show you all the individual transactions an objects. It prints a transaction id, and could be modified to convert those transaction ids to timestamps. From the timestamps and oids, you could probably figure out the last good transaction. You can use transactionalUndo() on every transaction id following the last good one. You might be able to go into the storage and truncate it at the last good transaction. You'd need to blow away the index, too. This sounds risky, but might be the simplest solution. (Backup the file first :-). Jeremy ___ 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] Re: [ZODB-Dev] Big problem.
Chris McDonough wrote: Try the original tranalyzer here instead: http://www.zope.org/Members/tsarna/Tranalyzer That's better, but it bombs out part way thru: Traceback (most recent call last): File ./tranalyzer.py, line 333, in ? main(sys.argv) File ./tranalyzer.py, line 325, in main t = Transaction(f, off, refs) File ./tranalyzer.py, line 170, in __init__ self.obs.append(Record(f, refs)) File ./tranalyzer.py, line 201, in __init__ self.prevrec = f.u64() File ./tranalyzer.py, line 121, in u64 self.checkleft(8) File ./tranalyzer.py, line 87, in checkleft raise 'Not enough data left, %d %d' % (self.left, n) Not enough data left, 0 8 Here are the last few things that it spit out: TID: 33E2AAB7A0AA1D5 @ 449542140 obs 1 len 7404 (status 'p') By david.s.carmichael.1 /people/david.s.carmichael.1/tutorial/Building My Pictures Page/manage_undo_transactions Undo 2001/07/24 14:23:12.6358 US/Eastern /people/david.s.carmichael.1/tutorial/Building My Pictures Page/manage_edit OID: 7e12a len 7120 TID: 33E2ABB4126FA3C @ 449549560 obs 2 len 1234 (status 'p') By david.s.carmichael.1 /people/david.s.carmichael.1/tutorial/manage_addVersion OID: 7cd46 len 798 OID: 86081 len 261 0 8 ___ 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] Re: [ZODB-Dev] Big problem.
Darn. At this point you can try just hacking off bits of file at the end of a *copy* of the Data.fs you have by using the trunctate method described in Itamar's howto. Start small and just cut off pieces at the end of the file until you're able to start Zope again. You might lose some data this way but at least it will start. After you get it to start, and you've lost data, you can also use (painfully slow) binary search to pinpoint where exactly you need to truncate on further copies. I am working on preventing this on the 2.5 branch now. It's ironic that I got on Jeremy's case for something like this not too long ago. ;-) Mea culpa. - C Andrew Sydelko wrote: Chris McDonough wrote: Try the original tranalyzer here instead: http://www.zope.org/Members/tsarna/Tranalyzer That's better, but it bombs out part way thru: Traceback (most recent call last): File ./tranalyzer.py, line 333, in ? main(sys.argv) File ./tranalyzer.py, line 325, in main t = Transaction(f, off, refs) File ./tranalyzer.py, line 170, in __init__ self.obs.append(Record(f, refs)) File ./tranalyzer.py, line 201, in __init__ self.prevrec = f.u64() File ./tranalyzer.py, line 121, in u64 self.checkleft(8) File ./tranalyzer.py, line 87, in checkleft raise 'Not enough data left, %d %d' % (self.left, n) Not enough data left, 0 8 Here are the last few things that it spit out: TID: 33E2AAB7A0AA1D5 @ 449542140 obs 1 len 7404 (status 'p') By david.s.carmichael.1 /people/david.s.carmichael.1/tutorial/Building My Pictures Page/manage_undo_transactions Undo 2001/07/24 14:23:12.6358 US/Eastern /people/david.s.carmichael.1/tutorial/Building My Pictures Page/manage_edit OID: 7e12a len 7120 TID: 33E2ABB4126FA3C @ 449549560 obs 2 len 1234 (status 'p') By david.s.carmichael.1 /people/david.s.carmichael.1/tutorial/manage_addVersion OID: 7cd46 len 798 OID: 86081 len 261 0 8 ___ 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 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] Re: [ZODB-Dev] Big problem.
Note that untarring the attached products into your 2.4 Products directory should allow you to start 2.4 up with the Data.fs from your foray into 2.5 without needing to truncate anything. At that point you should be able to delete the session_data_manager, temp_folder, and browser_id_manager objects and restart without the faux products. Andrew Sydelko wrote: Chris McDonough wrote: Darn. At this point you can try just hacking off bits of file at the end of a *copy* of the Data.fs you have by using the trunctate method described in Itamar's howto. Start small and just cut off pieces at the end of the file until you're able to start Zope again. You might lose some data this way but at least it will start. After you get it to start, and you've lost data, you can also use (painfully slow) binary search to pinpoint where exactly you need to truncate on further copies. I am working on preventing this on the 2.5 branch now. It's ironic that I got on Jeremy's case for something like this not too long ago. ;-) Mea culpa. Well, the plan for the night will be to bring the Data.fs up with 2.5.0b3 and export a critical part of the database. This part will be brought up on a separate 2.4.3 server. Then we will try to fix the problems we've been having with 2.5.0b3... Any quick pointers on where I can find info on exporting part of the database from the command line? Either thru a ZEO client (import Zope) or some other method... --andy. fauxproducts.tar.gz Description: GNU Zip compressed data
Re: [Zope-dev] Re: [ZODB-Dev] Big problem.
Chris McDonough wrote: Note that untarring the attached products into your 2.4 Products directory should allow you to start 2.4 up with the Data.fs from your foray into 2.5 without needing to truncate anything. At that point you should be able to delete the session_data_manager, temp_folder, and browser_id_manager objects and restart without the faux products. Hmmm... I would have liked that to work. I get things like 404 Not found on /manage_main and /. So, I'm trying to pursue your web export external method. --andy. ___ 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] Re: [ZODB-Dev] Big problem.
Whoops, that wasn't quite enough. Also do this: Create the following Python file as unscrew.py in your 2_4/lib/python directory and run it. import Zope app = Zope.app() app._delObject('session_data_manager') app._delObject('browser_id_manager') app._delObject('temp_folder') del app.__before_publishing_traverse__ get_transaction().commit() Note that if you've got access rules or site roots in your root dir, this will blow those away and you'll need to recreate them. Chris McDonough wrote: Note that untarring the attached products into your 2.4 Products directory should allow you to start 2.4 up with the Data.fs from your foray into 2.5 without needing to truncate anything. At that point you should be able to delete the session_data_manager, temp_folder, and browser_id_manager objects and restart without the faux products. Andrew Sydelko wrote: Chris McDonough wrote: Darn. At this point you can try just hacking off bits of file at the end of a *copy* of the Data.fs you have by using the trunctate method described in Itamar's howto. Start small and just cut off pieces at the end of the file until you're able to start Zope again. You might lose some data this way but at least it will start. After you get it to start, and you've lost data, you can also use (painfully slow) binary search to pinpoint where exactly you need to truncate on further copies. I am working on preventing this on the 2.5 branch now. It's ironic that I got on Jeremy's case for something like this not too long ago. ;-) Mea culpa. Well, the plan for the night will be to bring the Data.fs up with 2.5.0b3 and export a critical part of the database. This part will be brought up on a separate 2.4.3 server. Then we will try to fix the problems we've been having with 2.5.0b3... Any quick pointers on where I can find info on exporting part of the database from the command line? Either thru a ZEO client (import Zope) or some other method... --andy. ___ 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] Re: [ZODB-Dev] Big problem.
Chris McDonough wrote: Make sure you try the unscrew.py thing I sent over before doing that... Just tried it. It seemed to run fine, but I still get 404 Not found on /manage_main and 400 Bad Request on / --andy. ___ 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] Re: [ZODB-Dev] Big problem.
Chris McDonough wrote: Make sure you try the unscrew.py thing I sent over before doing that... sitting here waiting for you response to my last email saying that didn't work, I realized I hadn't deleted the cache before restarting. So, now that that the cache is gone, I restarted it up and it now works. Phew! Ok. So I _really_ appreciate your help on this. (Someone ought to create a document on what I just went through.) My next question is: What is the best way to recreate a clean Data.fs from the one I have currently (I'm thinking your answer is going to use your zopebackup.py external method.) --andy. ___ 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] more problems.
So, I thought I fixed my problems... But now I can't get to / or /manage_main again. Although I _can_ ftp in to see stuff. I don't understand the problem here... / returns 400 Bad Request /manage_main returns 404 Not Found --andy. ___ 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: [ZODB-Dev] more problems.
Is this before or after you applied the unscrew.py script? Andrew Sydelko wrote: So, I thought I fixed my problems... But now I can't get to / or /manage_main again. Although I _can_ ftp in to see stuff. I don't understand the problem here... / returns 400 Bad Request /manage_main returns 404 Not Found --andy. ___ For more information about ZODB, see the ZODB Wiki: http://www.zope.org/Wikis/ZODB/ ZODB-Dev mailing list - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zodb-dev -- Chris McDonoughZope Corporation http://www.zope.org http://www.zope.com Killing hundreds of birds with thousands of stones ___ 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] granting access to a single attribute with declarative security
On Wed, 2002-01-09 at 10:13, Wolfram Kerber wrote: I didn't think you could have more than one setDefaultAccess in a class. If you can, then you can set: security.setDefaultAccess('deny') security.setDefaultAccess({'meta_type': 1}) The last 'setDefaultAccess' statement in a class will define the actual behaviour, i.e use only one. But otherwise, you would have to list all attributes of the class in the dict of a single statement, wouldn't you? No, all attributes that aren't in the dict are private. Thanks, Wolfram. That was very informative. This will let classes that use declarative security have a deny by default policy, while still allowing access to certain attributes for backward compatibility. Michael Bernstein. ___ 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 )