[Zope] Looking up other row records in an SQLMethod?
Is it possible to look up other SQL record values while iterating through a DTML-IN? Sample Data returned by SQL Method: ID, ORDER 23, 1 25, 3 34, 6 39, 19 12, 23 Using a DTML IN I need to get the following during a single pass through the SqlMethod: HEADER ID ORDER PREV NEXT PASS 1 231null3 PASS 2 253 1 6 PASS 2 256 319 PASS 2 25 19 623 PASS 2 25 2319 null Calculating the PREV and NEXT is the problem and this cannot be done via SQL. 1. What is the syntax for writing out SQL Fields Directly? Say in a DTML-IN dtml-var ID dtml-var ORDER dtml-var "ORDER[0]" dtml-var "ORDER[2] Any Ideas?? Thanks in Advance. Theodore E. Patrick Ishophere.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] NESTED IN STATEMENTS AND PASSING VARIABLES in DTML
What is the DTML syntax for nested in statements. Here is an example. EXAMPLE 1: NO VARIABLE PASSING GOAL: loop 4 times and with each loop run the category_method and print out the results: dtml-in "1,2,3,4" dtml-in "category_method(id='1')" size=100 start=query_start id=dtml-var idseq=dtml-var seqvid=dtml-var vid /dtml-in /dtml-in WORKS! EXAMPLE 2: VARIABLE PASSING GOAL: Loop in the active_category_method and for each row run the category_method passing a new 'id' variable and print out the results. dtml-in "active_category_method()" dtml-in "category_method()" size=100 start=query_start id=dtml-var idseq=dtml-var seqvid=dtml-var vid /dtml-in /dtml-in ERROR -- ID is not being passed to "category_method()" Anyone have a solution out there? NOTE: active_category_method and category_method are SQL METHODS. Where 'id' is and SQL_VAR for category_method. Thanks in advance! Theodore E. Patrick Ishophere.com ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
RE: [Zope] NESTED IN STATEMENTS AND PASSING VARIABLES in DTML
THANKS A TON!!! I just found that the following solutions works also: I think the only difference is the id is evaluated in the namespace variable before invoking the SQL_METHOD dtml-in "active_category_method()" dtml-in "category_method(id=(_['id']))" size=100 start=query_start id=dtml-var idseq=dtml-var seqvid=dtml-var vid /dtml-in /dtml-in or dtml-in "1,2,323,23,23" dtml-in "category_method(id=(_['sequence_item']))" size=100 start=query_start id=dtml-var idseq=dtml-var seqvid=dtml-var vid /dtml-in /dtml-in Your point on the SQL_METHODS is a good one! I had no idea! Theodore E. Patrick -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Thursday, July 20, 2000 1:28 PM To: Theodore Patrick Cc: [EMAIL PROTECTED] Subject: Re: [Zope] NESTED IN STATEMENTS AND PASSING VARIABLES in DTML On Thu, Jul 20, 2000 at 12:27:01PM -0500, Theodore Patrick wrote: What is the DTML syntax for nested in statements. Here is an example. EXAMPLE 1: NO VARIABLE PASSING GOAL: loop 4 times and with each loop run the category_method and print out the results: dtml-in "1,2,3,4" dtml-in "category_method(id='1')" size=100 start=query_start id=dtml-var idseq=dtml-var seqvid=dtml-var vid /dtml-in /dtml-in WORKS! EXAMPLE 2: VARIABLE PASSING GOAL: Loop in the active_category_method and for each row run the category_method passing a new 'id' variable and print out the results. dtml-in "active_category_method()" dtml-in "category_method()" size=100 start=query_start id=dtml-var idseq=dtml-var seqvid=dtml-var vid /dtml-in /dtml-in ERROR -- ID is not being passed to "category_method()" Anyone have a solution out there? NOTE: active_category_method and category_method are SQL METHODS. Where 'id' is and SQL_VAR for category_method. This is FAQ material and should be inserted into either the DTML programmer's guide or the ZSQL Methods guide. It bites everyone who uses SQL methods eventually. ZSQL methods do not perform acquisition, but will look at REQUEST, change it to. dtml-in "active_category_method()" dtml-call "REQUEST.set('id', id)" dtml-in "category_method()" size=100 start=query_start id=dtml-var idseq=dtml-var seqvid=dtml-var vid /dtml-in /dtml-in If you have a lot of arguments that need to be captured, you can build a DTML Method, say setup_category_method_parameters that has these builds the REQUEST. Then your dtml can look like: dtml-in "active_category_method()" dtml-call setup_category_method_parameters dtml-in "category_method()" size=100 start=query_start id=dtml-var idseq=dtml-var seqvid=dtml-var vid /dtml-in /dtml-in Thanks in advance! Theodore E. Patrick Ishophere.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 )
[Zope] SECURITY ROLES and DTML-IN
I am having trouble rendering a DTML IN in ZOPE 2.2.0 to any user regardless of roles. I have allocated the proper rights to all objects used and nothing happens. The IN will not let any user view its contents. DTML IN I am using an IN in a DTML Document to render the contents of an SQL_Method from and Oracle Database. There are 3 objects. 1. Database Connection(ORACLE) - Working and can run test. OK 2. SQL_Method(VIEW_METHOD)- Working and can see results when run. SQL: select id, v_id vid, item_name name, url from item The SQL method returns columns: id, vid, name, url as expected. OK 3. DTML Document - Works fine with an IN that renders folder properties. Change the Source of the DTML IN to the SQL_Method and it will prompt me for user authentication. dtml-in VIEW_METHOD size=1000 start=query_start dtml-var id, dtml-var vid, dtml-var name, dtml-var url /dtml-in When used it prompts the user to login - REGARDLESS OF CURRENT LOGIN and returns the following error. Traceback (innermost last): File C:\PROGRA~1\island8\lib\python\ZPublisher\Publish.py, line 222, in publish_module File C:\PROGRA~1\island8\lib\python\ZPublisher\Publish.py, line 187, in publish File C:\PROGRA~1\island8\lib\python\ZPublisher\Publish.py, line 171, in publish File C:\PROGRA~1\island8\lib\python\ZPublisher\mapply.py, line 160, in mapply (Object: view) File C:\PROGRA~1\island8\lib\python\ZPublisher\Publish.py, line 112, in call_object (Object: view) File C:\PROGRA~1\island8\lib\python\OFS\DTMLMethod.py, line 167, in __call__ (Object: view) File C:\PROGRA~1\island8\lib\python\DocumentTemplate\DT_String.py, line 502, in __call__ (Object: view) File C:\PROGRA~1\island8\lib\python\DocumentTemplate\DT_In.py, line 602, in renderwb (Object: view_method) Things I have tried. 1. Opening up security all the way on all objects. Doesn't work. It continues to ask me to log-in. 2. Proxy the DTML Documents ROLE to a higher role for the SQL_METHOD. Fails just as before. Is this a bug? Can anyone else confirm this. PLATFORM: WINDOWS NT 4 ZOPE: 2.2.0 Final Release. ___ 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] ODBC connection to Oracle
We have had mixed results depending on the ODBC driver you use to make your DSN. Here is what I found. 1. Microsofts ODBC Driver for ORACLE on NT4.0, NT2000 -CREATE DSN -OK -ZOPE ZODBC -OK -ZSQL METHODS -OK 2. ORACLE ODBC DRIVER on NT 4.0, Especially NT2000 -CREATE DSN -OK -ZOPE ZODBC CONNECTION -OK Visually! On First Query it will break. -ZSQL METHODS -Broken When in doubt use the MICROSOFT DRIVER for ODBC! That is our rule. You will also find that this same problem exists in using ORACLE drivers when viewing databases via ACCESS. It will typically crash Access and potentially more. Theodore E. Patrick Ishophere.com - Indigo Networks -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Thursday, June 01, 2000 12:16 PM To: [EMAIL PROTECTED] Subject: [Zope] ODBC connection to Oracle Hi there, Has anyone tried connecting using ZODBC from a WinNT machine to an Oracle database? The ODBC connection works. But when I create a ZODBC connection from ODBC dsn, it doesn't. I give the connect string as DSN userid password as mentioned under ZODBC add screen... Any help? Thanks Babu http://vsbabu.csoft.net ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev ) ___ 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 )