There's a way to do a RESPONSE.redirect specifying a target=TOP? -- Diego Rodrigo Neufert System Administrator / Security Manager - Magic Web Design ----------------------------------------------------------- diego@magicwebdesign.com.br www.magicwebdesign.com.br Curitiba - PR - Brasil
I need to do this: <dtml-if x> <dtml-call "RESPONSE.redirect('http://lalala.com/')"> <dtml-else> HTML PAGE </dtml-if> But it's on a framed page, and when I do the redirect I need to kill all de frames to show the redirected page.... On Tuesday 03 April 2001 11:32, Chris Withers wrote:
Diego Rodrigo Neufert wrote:
There's a way to do a RESPONSE.redirect specifying a target=TOP?
How would you build that into an anchor on a page?
cheers,
Chris
_______________________________________________ Zope maillist - Zope@zope.org 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 )
-- Diego Rodrigo Neufert System Administrator / Security Manager - Magic Web Design ----------------------------------------------------------- diego@magicwebdesign.com.br www.magicwebdesign.com.br Curitiba - PR - Brasil
On Tue, 3 Apr 2001, Diego Rodrigo Neufert wrote:
I need to do this:
<dtml-if x> <dtml-call "RESPONSE.redirect('http://lalala.com/')"> <dtml-else> HTML PAGE </dtml-if>
But it's on a framed page, and when I do the redirect I need to kill all de frames to show the redirected page....
Very simple work for Javascript - one line, I think. Oleg. ---- Oleg Broytmann http://www.zope.org/Members/phd/ phd@phd.pp.ru Programmers don't die, they just GOSUB without RETURN.
This should work: <dtml-if x> <dtml-call "RESPONSE.setHeader('Window-target', '_top')"> <dtml-call "RESPONSE.redirect('http://lalala.com')"> <dtml-else> HTML PAGE </dtml-if> On 03 Apr 2001 11:41:02 -0300, Diego Rodrigo Neufert wrote:
I need to do this:
<dtml-if x> <dtml-call "RESPONSE.redirect('http://lalala.com/')"> <dtml-else> HTML PAGE </dtml-if>
But it's on a framed page, and when I do the redirect I need to kill all de frames to show the redirected page....
On Tuesday 03 April 2001 11:32, Chris Withers wrote:
Diego Rodrigo Neufert wrote:
There's a way to do a RESPONSE.redirect specifying a target=TOP?
How would you build that into an anchor on a page?
cheers,
Chris
_______________________________________________ Zope maillist - Zope@zope.org 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 )
-- Diego Rodrigo Neufert System Administrator / Security Manager - Magic Web Design ----------------------------------------------------------- diego@magicwebdesign.com.br www.magicwebdesign.com.br Curitiba - PR - Brasil
_______________________________________________ Zope maillist - Zope@zope.org 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 )
On 4 Apr 2001, M. Adam Kendall wrote:
<dtml-call "RESPONSE.setHeader('Window-target', '_top')">
Few browsers understand it. Oleg. ---- Oleg Broytmann http://www.zope.org/Members/phd/ phd@phd.pp.ru Programmers don't die, they just GOSUB without RETURN.
Oleg's right, better to redirect to a page with a bit of javascript on that does the actual redirect to top. ----- Original Message ----- From: "Oleg Broytmann" <phd@phd.fep.ru>
On 4 Apr 2001, M. Adam Kendall wrote:
<dtml-call "RESPONSE.setHeader('Window-target', '_top')">
Few browsers understand it.
Oleg.
I want to run an SQL query, like select * from person Then I want to extract the column names from the returned data. In other words, I don't want to hand-code them into the result page. I know how to do this in Cold Fusion, but I don't know how in Zope. I'm using a ZSQL method, of course, to query the database. Anyone know how to do this without running an external method? Tom P
I have found something that does this but haven't managed to make it work as I want it to yet! <dtml-let Fields="queries.qryreturnallusers().names()"> <dtml-in Fields> <dtml-var sequence-item></p> </dtml-in> </dtml-let> This gives the column headers If anyone knows of a way of doing this which gives the data as well as the headers in one fail swoop then let me know too. Laurie -----Original Message----- From: zope-admin@zope.org [mailto:zope-admin@zope.org]On Behalf Of Thomas B. Passin Sent: Wednesday, April 04, 2001 10:51 AM To: Zope Mailing List Subject: [Zope] Get Column Names from SQL Query? I want to run an SQL query, like select * from person Then I want to extract the column names from the returned data. In other words, I don't want to hand-code them into the result page. I know how to do this in Cold Fusion, but I don't know how in Zope. I'm using a ZSQL method, of course, to query the database. Anyone know how to do this without running an external method? Tom P _______________________________________________ Zope maillist - Zope@zope.org 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 )
Have you tried: http://www.zope.org/Members/teyc/howtoSQLVariables Jose' Laurie Nason wrote:
I have found something that does this but haven't managed to make it work as I want it to yet! <dtml-let Fields="queries.qryreturnallusers().names()"> <dtml-in Fields> <dtml-var sequence-item></p> </dtml-in> </dtml-let> This gives the column headers If anyone knows of a way of doing this which gives the data as well as the headers in one fail swoop then let me know too.
Laurie
-----Original Message----- From: zope-admin@zope.org [mailto:zope-admin@zope.org]On Behalf Of Thomas B. Passin Sent: Wednesday, April 04, 2001 10:51 AM To: Zope Mailing List Subject: [Zope] Get Column Names from SQL Query?
I want to run an SQL query, like
select * from person
Then I want to extract the column names from the returned data. In other words, I don't want to hand-code them into the result page.
I know how to do this in Cold Fusion, but I don't know how in Zope.
I'm using a ZSQL method, of course, to query the database.
Anyone know how to do this without running an external method?
Tom P
_______________________________________________ Zope maillist - Zope@zope.org 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 - Zope@zope.org 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 )
OK this helps, but what I am trying to do is to generate a general report for any table - if I use the following dtml - how do I access the actual data retrieved by the query? I could call the query again and get the data but in terms of efficiency that is not too practical. I have looked for the dtml that is called when a query is tested but haven't found it yet! <dtml-with "queries.qrytest()"> <table border=1 > <tr> <dtml-in names> <th><dtml-var sequence-item></th> </dtml-in> </tr> <dtml-comment> I WANT TO PUT THE DATA FROM THE QUERY HERE </dtml-comment> <tr> <dtml-in ??????> <td><dtml-var ????></td> </dtml-in> </tr> </table> </dtml-with> -----Original Message----- From: zope-admin@zope.org [mailto:zope-admin@zope.org]On Behalf Of Jose Soares Sent: Monday, April 09, 2001 2:51 AM To: Laurie Nason Cc: Thomas B. Passin; Zope Mailing List Subject: Re: [Zope] Get Column Names from SQL Query? Have you tried: http://www.zope.org/Members/teyc/howtoSQLVariables Jose' Laurie Nason wrote:
I have found something that does this but haven't managed to make it work as I want it to yet! <dtml-let Fields="queries.qryreturnallusers().names()"> <dtml-in Fields> <dtml-var sequence-item></p> </dtml-in> </dtml-let> This gives the column headers If anyone knows of a way of doing this which gives the data as well as the headers in one fail swoop then let me know too.
Laurie
-----Original Message----- From: zope-admin@zope.org [mailto:zope-admin@zope.org]On Behalf Of Thomas B. Passin Sent: Wednesday, April 04, 2001 10:51 AM To: Zope Mailing List Subject: [Zope] Get Column Names from SQL Query?
I want to run an SQL query, like
select * from person
Then I want to extract the column names from the returned data. In other words, I don't want to hand-code them into the result page.
I know how to do this in Cold Fusion, but I don't know how in Zope.
I'm using a ZSQL method, of course, to query the database.
Anyone know how to do this without running an external method?
Tom P
_______________________________________________ Zope maillist - Zope@zope.org 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 - Zope@zope.org 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 - Zope@zope.org 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 )
Laurie Nason wrote:
OK this helps, but what I am trying to do is to generate a general report for any table - if I use the following dtml - how do I access the actual data retrieved by the query? I could call the query again and get the data but in terms of efficiency that is not too practical. I have looked for the dtml that is called when a query is tested but haven't found it yet!
<dtml-with "queries.qrytest()">
<table border=1 > <tr> <dtml-in names> <th><dtml-var sequence-item></th> </dtml-in> </tr> <dtml-comment> I WANT TO PUT THE DATA FROM THE QUERY HERE </dtml-comment> <tr> <dtml-in ??????> <td><dtml-var ????></td> </dtml-in> </tr> </table> </dtml-with>
Here is some tested DTML code to create an HTML table from any given SQL query: <table border="1"> <dtml-with name="sqlMethod"> <tr> <dtml-in name="names"> <th>&dtml-sequence-item;</th> </dtml-in> </tr> <dtml-in name="dictionaries"> <tr> <dtml-in name="values"> <td>&dtml-sequence-item;</td> </dtml-in> </tr> </dtml-in> </dtml-with> </table> hth, -- | Casey Duncan | Kaivo, Inc. | cduncan@kaivo.com `------------------>
Casey Duncan wrote:
Laurie Nason wrote:
OK this helps, but what I am trying to do is to generate a general report for any table - if I use the following dtml - how do I access the actual data retrieved by the query? I could call the query again and get the data but in terms of efficiency that is not too practical. I have looked for the dtml that is called when a query is tested but haven't found it yet!
<dtml-with "queries.qrytest()">
<table border=1 > <tr> <dtml-in names> <th><dtml-var sequence-item></th> </dtml-in> </tr> <dtml-comment> I WANT TO PUT THE DATA FROM THE QUERY HERE </dtml-comment> <tr> <dtml-in ??????> <td><dtml-var ????></td> </dtml-in> </tr> </table> </dtml-with>
Here is some tested DTML code to create an HTML table from any given SQL query:
<table border="1"> <dtml-with name="sqlMethod"> <tr> <dtml-in name="names"> <th>&dtml-sequence-item;</th> </dtml-in> </tr> <dtml-in name="dictionaries"> <tr> <dtml-in name="values"> <td>&dtml-sequence-item;</td> </dtml-in> </tr> </dtml-in> </dtml-with> </table>
Actually, that may not put the values under the right columns, try this instead: <table border="1"> <dtml-with name="sqlMethod"> <dtml-in name="dictionaries"> <dtml-if name="sequence-start"> <tr> <dtml-in name="keys"> <th>&dtml-sequence-item;</th> </dtml-in> <tr> </dtml-if> <tr> <dtml-in name="values"> <td>&dtml-sequence-item;</td> </dtml-in> </tr> </dtml-in> </dtml-with> </table> -- | Casey Duncan | Kaivo, Inc. | cduncan@kaivo.com `------------------>
Excellent - this is exactly what I was looking for except that I didn't need <dtml-with name="sqlMethod"> rather, I used <dtml-with "sqlMethod"> Thanks again for the help. Laurie -----Original Message----- From: zope-admin@zope.org [mailto:zope-admin@zope.org]On Behalf Of Casey Duncan Sent: Monday, April 09, 2001 2:43 PM To: Laurie Nason; Jose Soares; Thomas B. Passin; Zope Mailing List Subject: Re: [Zope] Get Column Names from SQL Query? Casey Duncan wrote:
Laurie Nason wrote:
OK this helps, but what I am trying to do is to generate a general
report
for any table - if I use the following dtml - how do I access the actual data retrieved by the query? I could call the query again and get the data but in terms of efficiency that is not too practical. I have looked for the dtml that is called when a query is tested but haven't found it yet!
<dtml-with "queries.qrytest()">
<table border=1 > <tr> <dtml-in names> <th><dtml-var sequence-item></th> </dtml-in> </tr> <dtml-comment> I WANT TO PUT THE DATA FROM THE QUERY HERE </dtml-comment> <tr> <dtml-in ??????> <td><dtml-var ????></td> </dtml-in> </tr> </table> </dtml-with>
Here is some tested DTML code to create an HTML table from any given SQL query:
<table border="1"> <dtml-with name="sqlMethod"> <tr> <dtml-in name="names"> <th>&dtml-sequence-item;</th> </dtml-in> </tr> <dtml-in name="dictionaries"> <tr> <dtml-in name="values"> <td>&dtml-sequence-item;</td> </dtml-in> </tr> </dtml-in> </dtml-with> </table>
Actually, that may not put the values under the right columns, try this instead: <table border="1"> <dtml-with name="sqlMethod"> <dtml-in name="dictionaries"> <dtml-if name="sequence-start"> <tr> <dtml-in name="keys"> <th>&dtml-sequence-item;</th> </dtml-in> <tr> </dtml-if> <tr> <dtml-in name="values"> <td>&dtml-sequence-item;</td> </dtml-in> </tr> </dtml-in> </dtml-with> </table> -- | Casey Duncan | Kaivo, Inc. | cduncan@kaivo.com `------------------> _______________________________________________ Zope maillist - Zope@zope.org 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 )
This is very slick, but - I hate to say it - it fails on my system. I cut-and-pasted the code. It throws a key error on "dictionaries". Have you defined something clever elsewhere that supplies "dictionaries"? I'd like this to work since my own code for doing it isn't quite as slick. Cheers, Tom P Casey Duncan wrote -
Here is some tested DTML code to create an HTML table from any given SQL query:
<table border="1"> <dtml-with name="sqlMethod"> <tr> <dtml-in name="names"> <th>&dtml-sequence-item;</th> </dtml-in> </tr> <dtml-in name="dictionaries"> <tr> <dtml-in name="values"> <td>&dtml-sequence-item;</td> </dtml-in> </tr> </dtml-in> </dtml-with> </table>
"Thomas B. Passin" wrote:
This is very slick, but - I hate to say it - it fails on my system. I cut-and-pasted the code. It throws a key error on "dictionaries". Have you defined something clever elsewhere that supplies "dictionaries"? I'd like this to work since my own code for doing it isn't quite as slick.
Cheers,
What version of Zope? This was tested against 2.3.1 -- | Casey Duncan | Kaivo, Inc. | cduncan@kaivo.com `------------------>
Version 2.3.0 Casey Duncan wrote -
"Thomas B. Passin" wrote:
This is very slick, but - I hate to say it - it fails on my system. I cut-and-pasted the code. It throws a key error on "dictionaries". Have
you
defined something clever elsewhere that supplies "dictionaries"? I'd like this to work since my own code for doing it isn't quite as slick.
Cheers,
What version of Zope? This was tested against 2.3.1
"Thomas B. Passin" wrote:
Version 2.3.0
Casey Duncan wrote -
"Thomas B. Passin" wrote:
This is very slick, but - I hate to say it - it fails on my system. I cut-and-pasted the code. It throws a key error on "dictionaries". Have
you
defined something clever elsewhere that supplies "dictionaries"? I'd like this to work since my own code for doing it isn't quite as slick.
Cheers,
What version of Zope? This was tested against 2.3.1
A quick check of the 2.3.0 code shows support for "dictionaries" as part of a sqlMethod's result class. My only other thought is that perhaps the DA is overriding it somehow, although I doubt that is possible. Even using a class to wrap the results (advanced tab of ZSQL method) shouldn't affect this. -- | Casey Duncan | Kaivo, Inc. | cduncan@kaivo.com `------------------>
Casey Duncan said -
A quick check of the 2.3.0 code shows support for "dictionaries" as part of a sqlMethod's result class. My only other thought is that perhaps the DA is overriding it somehow, although I doubt that is possible. Even using a class to wrap the results (advanced tab of ZSQL method) shouldn't affect this.
OK, thanks for finding that. I'll experiment some more. BTW, when did Zope start allowing that entity notation '&dtml-sequence-item;'? And can it be used elsewhere besides an sql method? Hmm, the version of the zsqlmethod product I have is Revision: 1.16, according to the __init__.py file. Maybe this isn't new enough? Cheers, Tom P
"Thomas B. Passin" wrote:
Casey Duncan said -
A quick check of the 2.3.0 code shows support for "dictionaries" as part of a sqlMethod's result class. My only other thought is that perhaps the DA is overriding it somehow, although I doubt that is possible. Even using a class to wrap the results (advanced tab of ZSQL method) shouldn't affect this.
OK, thanks for finding that. I'll experiment some more. BTW, when did Zope start allowing that entity notation '&dtml-sequence-item;'? And can it be used elsewhere besides an sql method?
Hmm, the version of the zsqlmethod product I have is Revision: 1.16, according to the __init__.py file. Maybe this isn't new enough?
Cheers,
Tom P
The entity syntax has ben around awhile, you can use it anywhere in place of dtml-var. Very handy, plus you get html_quote for free. Are you putting this DTML into an actual SQL method? If so that is why it isn't working. It needs to be in a separate DTML method or Document. -- | Casey Duncan | Kaivo, Inc. | cduncan@kaivo.com `------------------>
Casey Duncan wrote -
The entity syntax has ben around awhile, you can use it anywhere in place of dtml-var. Very handy, plus you get html_quote for free.
Are you putting this DTML into an actual SQL method? If so that is why it isn't working. It needs to be in a separate DTML method or Document.
I pasted into a dtml document, not an sql method. You know, I did a search and didn't find "dictionaries" in the whole zope tree. Where did you say it is? This is Zope 2.3.0 on Win2000. Thanks for your efforts so far. Tom P
"Thomas B. Passin" wrote:
Casey Duncan wrote -
The entity syntax has ben around awhile, you can use it anywhere in place of dtml-var. Very handy, plus you get html_quote for free.
Are you putting this DTML into an actual SQL method? If so that is why it isn't working. It needs to be in a separate DTML method or Document.
I pasted into a dtml document, not an sql method.
You know, I did a search and didn't find "dictionaries" in the whole zope tree. Where did you say it is? This is Zope 2.3.0 on Win2000.
Thanks for your efforts so far.
Tom P
{zopedir}/lib/python/Shared/DC/ZRDB/Results.py (line 183) a mouthful to be sure... 8^) -- | Casey Duncan | Kaivo, Inc. | cduncan@kaivo.com `------------------>
Casey Duncan wroe -
"Thomas B. Passin" wrote:
You know, I did a search and didn't find "dictionaries" in the whole
zope
tree. Where did you say it is? This is Zope 2.3.0 on Win2000.
{zopedir}/lib/python/Shared/DC/ZRDB/Results.py (line 183)
Ah, I see it at last. Hmm, there's other interesting little methods too, aren't there? Thanks. TOm P
Here is my version of dtml code to display an arbitrary database query including column headers. It doesn't use Casey Duncan's fancy entities and dictionaries. This code is about as lean and clean as I can make it, except for comments I have added for explanation. Your ZSQL query is named "theQuery". It gets executed (once only) when the <dtml-let> is evaluated. <dtml-let results=theQuery> <table border='1'> <!-- Headers --> <tr> <dtml-in "results.names()"><!-- Loop over column names --> <th><dtml-var sequence-item></th> </dtml-in> </tr> <!-- Data--> <dtml-in results><!-- Loop over rows--> <tr> <dtml-in sequence-item> <!-- Loop over columns--> <td><dtml-var sequence-item></td> </dtml-in> </tr> </dtml-in> </table> Total of <dtml-var "_.len(results)"> Rows </dtml-let> Cheers, Tom P
"Thomas B. Passin" wrote:
I want to run an SQL query, like
select * from person
Then I want to extract the column names from the returned data. In other words, I don't want to hand-code them into the result page.
I know how to do this in Cold Fusion, but I don't know how in Zope.
I'm using a ZSQL method, of course, to query the database.
Anyone know how to do this without running an external method?
Tom P
I think you should be able to do something like this (untested): <dtml-with name="sqlMethod"> <dtml-in name="dictionaries"> <dtml-in name="sequence-item" mapping> <dtml-var name="sequence-key">: <dtml-var name="sequence-item"><br /> </dtml-in> </dtml-in> </dtml-in> or as a python script: rows = context.sqlMethod(REQUEST).dictionaries() for row in rows: for field = row.keys(): ...whatever you want to do here (field name = field, value = row[field])... -- | Casey Duncan | Kaivo, Inc. | cduncan@kaivo.com `------------------>
Thanks, but neither of these work. What am I missing? [Casey Duncan]
I think you should be able to do something like this (untested):
<dtml-with name="sqlMethod"> <dtml-in name="dictionaries"> <dtml-in name="sequence-item" mapping> <dtml-var name="sequence-key">: <dtml-var name="sequence-item"><br /> </dtml-in> </dtml-in> </dtml-in>
My sql method has no attribute named "dictionaries", so this fails. What do you have, that you are calling "sqlMethod", that does have a dictionaries attribute? [Laurie Nason] <dtml-let Fields="queries.qryreturnallusers().names()"> <dtml-in Fields> <dtml-var sequence-item></p> </dtml-in> </dtml-let> I assume that your sqlMethod is called "queries". My sql method has no attribute (i.e., method) called qryreturnallusers, so this way fails too. How did you get a method with that name associated with your sql method? Thanks, Tom P
Sorry about that - I have all my queries in a directory called queries and the name of the query is qryreturnallusers. The bit you need is the .names() on the end of whatever query you are calling. HTH L %:-} -----Original Message----- From: zope-admin@zope.org [mailto:zope-admin@zope.org]On Behalf Of Thomas B. Passin Sent: Wednesday, April 04, 2001 1:33 PM To: Zope Mailing List Subject: Re: [Zope] Get Column Names from SQL Query? Thanks, but neither of these work. What am I missing? [Casey Duncan]
I think you should be able to do something like this (untested):
<dtml-with name="sqlMethod"> <dtml-in name="dictionaries"> <dtml-in name="sequence-item" mapping> <dtml-var name="sequence-key">: <dtml-var name="sequence-item"><br /> </dtml-in> </dtml-in> </dtml-in>
My sql method has no attribute named "dictionaries", so this fails. What do you have, that you are calling "sqlMethod", that does have a dictionaries attribute? [Laurie Nason] <dtml-let Fields="queries.qryreturnallusers().names()"> <dtml-in Fields> <dtml-var sequence-item></p> </dtml-in> </dtml-let> I assume that your sqlMethod is called "queries". My sql method has no attribute (i.e., method) called qryreturnallusers, so this way fails too. How did you get a method with that name associated with your sql method? Thanks, Tom P _______________________________________________ Zope maillist - Zope@zope.org 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 )
"Thomas B. Passin" wrote:
Thanks, but neither of these work. What am I missing?
[Casey Duncan]
I think you should be able to do something like this (untested):
<dtml-with name="sqlMethod"> <dtml-in name="dictionaries"> <dtml-in name="sequence-item" mapping> <dtml-var name="sequence-key">: <dtml-var name="sequence-item"><br /> </dtml-in> </dtml-in> </dtml-in>
My sql method has no attribute named "dictionaries", so this fails. What do you have, that you are calling "sqlMethod", that does have a dictionaries attribute?
"dictionarys" is a method of the ZSQL result object. Perhaps this might work better: <dtml-in expr="sqlMethod(REQUEST).dictionaries()"> <dtml-in name="sequence-item" mapping> <dtml-var name="sequence-key">: <dtml-var name="sequence-item"><br /> </dtml-in> </dtml-in> -- | Casey Duncan | Kaivo, Inc. | cduncan@kaivo.com `------------------>
On Thu, 5 Apr 2001 01:50, Thomas B. Passin wrote:
I want to run an SQL query, like
select * from person
Then I want to extract the column names from the returned data. In other words, I don't want to hand-code them into the result page.
I ran into this some months back... it's actually quite easy to do when you realise the returned object from a Z SQL Method is _not_ just a list... check the ZQR for it's members... Here is what I use to get the field names: <dtml-call "REQUEST.set('fieldList',sql.GetDocketDetails(DocketNo=1).names())">
I'm using a ZSQL method, of course, to query the database.
Anyone know how to do this without running an external method?
Tom P
Did you search through the mailing list logs before posting? Have a better one, Curtis Maloney
Chris Withers asked -
Diego Rodrigo Neufert wrote:
There's a way to do a RESPONSE.redirect specifying a target=TOP?
How would you build that into an anchor on a page?
Add a "target" attribute to the anchor: <a href-'....' target='TOP">....</a> No redirect needed. Similarly for forms. Cheers, Tom P
I know that, but I need to use RESPONSE.redirect.... On Tuesday 03 April 2001 11:58, Thomas B. Passin wrote:
Chris Withers asked -
Diego Rodrigo Neufert wrote:
There's a way to do a RESPONSE.redirect specifying a target=TOP?
How would you build that into an anchor on a page?
Add a "target" attribute to the anchor:
<a href-'....' target='TOP">....</a>
No redirect needed. Similarly for forms.
Cheers,
Tom P
_______________________________________________ Zope maillist - Zope@zope.org 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 )
-- Diego Rodrigo Neufert System Administrator / Security Manager - Magic Web Design ----------------------------------------------------------- diego@magicwebdesign.com.br www.magicwebdesign.com.br Curitiba - PR - Brasil
Diego Rodrigo Neufert wrote:
I know that, but I need to use RESPONSE.redirect....
Redirect cannot do that AFIAK. If this is in response to a form request, you could accomplish this by setting the form target to "_top" and having the action method either return (or redirect to) the frameset again or the single page sans frames. -- | Casey Duncan | Kaivo, Inc. | cduncan@kaivo.com `------------------>
It's exactly what I needed! Thank you.... On Tuesday 03 April 2001 13:40, Casey Duncan wrote:
Diego Rodrigo Neufert wrote:
I know that, but I need to use RESPONSE.redirect....
Redirect cannot do that AFIAK. If this is in response to a form request, you could accomplish this by setting the form target to "_top" and having the action method either return (or redirect to) the frameset again or the single page sans frames.
-- Diego Rodrigo Neufert System Administrator / Security Manager - Magic Web Design ----------------------------------------------------------- diego@magicwebdesign.com.br www.magicwebdesign.com.br Curitiba - PR - Brasil
participants (10)
-
Casey Duncan -
Chris Withers -
Curtis Maloney -
Diego Rodrigo Neufert -
Jose Soares -
Laurie Nason -
M. Adam Kendall -
Oleg Broytmann -
Phil Harris -
Thomas B. Passin