Greetings. I am trying to create an open source communal translation zope product thingy and have run into a snag. I had everything working, but then I realized that I needed to distinguish between what the language that the original document bein translated was in, which required passing an additional paramater to my query to gadfly. Well, this supposedly "broke the paramater chain" requiring me to explicitly add positional paramaters. The problem is, though I no longer get an error, no results are returned from my table. The paramaters are filtering the query, so I believe that my values are getting altered in some way that is causing them to not match anything. Here is what I suspect is causing me trouble . . .(the "----------------->" part): <dtml-var name><br> <dtml-var doclang> <form action="parsegettranslation.py" method="get"> -----------> <dtml-in expr="gettransdoc(_.None,_,name='name',doclang='doclang')"> <br> <dtml-var ordering> <dtml-var content> <br> Thanks!
Ivan Stout wrote at 2005-3-10 18:24 +0900:
... <form action="parsegettranslation.py" method="get"> -----------> <dtml-in expr="gettransdoc(_.None,_,name='name',doclang='doclang')">
What is "gettransdoc"?
From the way you call it, it should be a DTML object. However, you do not say anything about a DTML object in your (stripped) description. Hopefully, it is not a Z SQL Method (they do not have the two positional arguments).
-- Dieter
It is not clear to me why you would pass None parameters to a select query. Typically your query would have named arguments (name and doclang) like this: select * from yourTable where name=<dtml-sqlvar name type=string> and doclang=<dtml-sqlvar doclang type=string> Leave out the last line if you don't want to select and doclang. Then call the query like this: <dtml-in expr="gettransdoc(name=name,doclang=doclang)"> <dtml-var ordering> <dtml-var content><br> </dtml-in> Cliff Ivan Stout wrote:
Greetings. I am trying to create an open source communal translation zope product thingy and have run into a snag. I had everything working, but then I realized that I needed to distinguish between what the language that the original document bein translated was in, which required passing an additional paramater to my query to gadfly. Well, this supposedly "broke the paramater chain" requiring me to explicitly add positional paramaters. The problem is, though I no longer get an error, no results are returned from my table. The paramaters are filtering the query, so I believe that my values are getting altered in some way that is causing them to not match anything. Here is what I suspect is causing me trouble . . .(the "----------------->" part):
<dtml-var name><br> <dtml-var doclang> <form action="parsegettranslation.py" method="get"> -----------> <dtml-in expr="gettransdoc(_.None,_,name='name',doclang='doclang')"> <br> <dtml-var ordering> <dtml-var content> <br>
Thanks! _______________________________________________ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Dieter, Thanks, it is a Z SQL method . . . I will get rid of the positional place holders. Cliff, Thanks for the response. I did the following: DTML METHOD file: <html> <dtml-var name><br> <dtml-var doclang> <form action="parsegettranslation.py" method="get"> <dtml-in expr="gettransdoc(name=name,doclang=doclang)"> #changed here <br> <dtml-var ordering> <dtml-var content> gettransdoc Z SQL Method file: (ARGUMENTS:name doclang) select * from document where name=<dtml-sqlvar name type=string> and doclang=<dtml-sqlvar doclang type=string> This is what I get: "Error Type: NameError Error Value: 'DOCLANG': ambiguous or unknown attribute" However, if I add a single quote to the DTML Method, like this: <dtml-in expr="gettransdoc(name='name',doclang='doclang')"> I do not get an error, but I do not get my query results either . . . Are the single quotes getting literally passed to the query or something? On Thu, 10 Mar 2005 22:11:58 +0000, Cliff Ford <Cliff.Ford@ed.ac.uk> wrote:
It is not clear to me why you would pass None parameters to a select query. Typically your query would have named arguments (name and doclang) like this:
select * from yourTable where name=<dtml-sqlvar name type=string> and doclang=<dtml-sqlvar doclang type=string>
Leave out the last line if you don't want to select and doclang.
Then call the query like this:
<dtml-in expr="gettransdoc(name=name,doclang=doclang)"> <dtml-var ordering> <dtml-var content><br> </dtml-in>
Cliff
Ivan Stout wrote:
Greetings. I am trying to create an open source communal translation zope product thingy and have run into a snag. I had everything working, but then I realized that I needed to distinguish between what the language that the original document bein translated was in, which required passing an additional paramater to my query to gadfly. Well, this supposedly "broke the paramater chain" requiring me to explicitly add positional paramaters. The problem is, though I no longer get an error, no results are returned from my table. The paramaters are filtering the query, so I believe that my values are getting altered in some way that is causing them to not match anything. Here is what I suspect is causing me trouble . . .(the "----------------->" part):
<dtml-var name><br> <dtml-var doclang> <form action="parsegettranslation.py" method="get"> -----------> <dtml-in expr="gettransdoc(_.None,_,name='name',doclang='doclang')"> <br> <dtml-var ordering> <dtml-var content> <br>
Thanks! _______________________________________________ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
In the call to the ZSQL Method, in doclang=doclang the first doclang is the name of the variable declared in the ZSQL method and the second doclang is the content of the variable with that name in the DTML Method. So if you put the second doclang in quotes you pas the string 'doclang' rather than the content of the doclang variable. That explains why the latter does not cause an error but returns no results. It is often less confusing to use different names for the argument name and value, for example DocLangField=testLanguage (or docLangField='English'). The error value you have quoted (Error Value: 'DOCLANG':) suggests the problem may be case sensitivity. Check that the case of the Database Field that you are testing matches the case of the name you are passing to the query. One gotcha to be aware of is that some databases accept field names in any case but return field names in upper case. For example, you may be able to do this: select * from table where doclang is not null but find that the return field name is DOCLANG. Not sure if this is relevant in this case. Cliff Ivan Stout wrote:
Dieter,
Thanks, it is a Z SQL method . . . I will get rid of the positional place holders.
Cliff,
Thanks for the response.
I did the following:
DTML METHOD file:
<html> <dtml-var name><br> <dtml-var doclang> <form action="parsegettranslation.py" method="get"> <dtml-in expr="gettransdoc(name=name,doclang=doclang)"> #changed here <br> <dtml-var ordering> <dtml-var content>
gettransdoc Z SQL Method file:
(ARGUMENTS:name doclang)
select * from document where name=<dtml-sqlvar name type=string> and doclang=<dtml-sqlvar doclang type=string>
This is what I get:
"Error Type: NameError Error Value: 'DOCLANG': ambiguous or unknown attribute"
However, if I add a single quote to the DTML Method, like this: <dtml-in expr="gettransdoc(name='name',doclang='doclang')">
I do not get an error, but I do not get my query results either . . . Are the single quotes getting literally passed to the query or something?
On Thu, 10 Mar 2005 22:11:58 +0000, Cliff Ford <Cliff.Ford@ed.ac.uk> wrote:
It is not clear to me why you would pass None parameters to a select query. Typically your query would have named arguments (name and doclang) like this:
select * from yourTable where name=<dtml-sqlvar name type=string> and doclang=<dtml-sqlvar doclang type=string>
Leave out the last line if you don't want to select and doclang.
Then call the query like this:
<dtml-in expr="gettransdoc(name=name,doclang=doclang)"> <dtml-var ordering> <dtml-var content><br> </dtml-in>
Cliff
Ivan Stout wrote:
Greetings. I am trying to create an open source communal translation zope product thingy and have run into a snag. I had everything working, but then I realized that I needed to distinguish between what the language that the original document bein translated was in, which required passing an additional paramater to my query to gadfly. Well, this supposedly "broke the paramater chain" requiring me to explicitly add positional paramaters. The problem is, though I no longer get an error, no results are returned from my table. The paramaters are filtering the query, so I believe that my values are getting altered in some way that is causing them to not match anything. Here is what I suspect is causing me trouble . . .(the "----------------->" part):
<dtml-var name><br> <dtml-var doclang> <form action="parsegettranslation.py" method="get"> -----------> <dtml-in expr="gettransdoc(_.None,_,name='name',doclang='doclang')"> <br> <dtml-var ordering> <dtml-var content> <br>
Thanks! _______________________________________________ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
_______________________________________________ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Cliff, Thanks, but I am still having trouble (even after changing variable names, cases) . . . let me explain more what I am trying to do. 1) I have a table called Document (doclang, ordering, content, submitdate, name, submitter) 2) A document (say "GPL") gets broken down and inserted into the Document table, one sentence at a time. 3) A DTML Method uses a Z SQL method to create a list of what documents are in Document and creates URLs to form_for_translation (DTML Method) with "?name=<dtml-var doclang>&doclang=<dtml-var doclang>" added on the end. (Note: Is there a better way to create a list of links that passes paramaters to a DTML method when clicked?) 4) When a link is clicked the 2 paramaters get passed to form_for_translation, which passes them to a Z SQL method that queries the Document table, allowing form_for_translation to create a form that displays each sentece. This all worked when I was only passing one paramater ("name"), but being able to keep track documents in different languages (with "doclang") would be a great feature. However, adding doclang causes the "ambigous" error . . . On Fri, 11 Mar 2005 08:26:19 +0000, Cliff Ford <Cliff.Ford@ed.ac.uk> wrote:
In the call to the ZSQL Method, in doclang=doclang the first doclang is the name of the variable declared in the ZSQL method and the second doclang is the content of the variable with that name in the DTML Method. So if you put the second doclang in quotes you pas the string 'doclang' rather than the content of the doclang variable. That explains why the latter does not cause an error but returns no results. It is often less confusing to use different names for the argument name and value, for example DocLangField=testLanguage (or docLangField='English').
The error value you have quoted (Error Value: 'DOCLANG':) suggests the problem may be case sensitivity. Check that the case of the Database Field that you are testing matches the case of the name you are passing to the query. One gotcha to be aware of is that some databases accept field names in any case but return field names in upper case. For example, you may be able to do this:
select * from table where doclang is not null
but find that the return field name is DOCLANG. Not sure if this is relevant in this case.
Cliff
Ivan Stout wrote:
Dieter,
Thanks, it is a Z SQL method . . . I will get rid of the positional place holders.
Cliff,
Thanks for the response.
I did the following:
DTML METHOD file:
<html> <dtml-var name><br> <dtml-var doclang> <form action="parsegettranslation.py" method="get"> <dtml-in expr="gettransdoc(name=name,doclang=doclang)"> #changed here <br> <dtml-var ordering> <dtml-var content>
gettransdoc Z SQL Method file:
(ARGUMENTS:name doclang)
select * from document where name=<dtml-sqlvar name type=string> and doclang=<dtml-sqlvar doclang type=string>
This is what I get:
"Error Type: NameError Error Value: 'DOCLANG': ambiguous or unknown attribute"
However, if I add a single quote to the DTML Method, like this: <dtml-in expr="gettransdoc(name='name',doclang='doclang')">
I do not get an error, but I do not get my query results either . . . Are the single quotes getting literally passed to the query or something?
On Thu, 10 Mar 2005 22:11:58 +0000, Cliff Ford <Cliff.Ford@ed.ac.uk> wrote:
It is not clear to me why you would pass None parameters to a select query. Typically your query would have named arguments (name and doclang) like this:
select * from yourTable where name=<dtml-sqlvar name type=string> and doclang=<dtml-sqlvar doclang type=string>
Leave out the last line if you don't want to select and doclang.
Then call the query like this:
<dtml-in expr="gettransdoc(name=name,doclang=doclang)"> <dtml-var ordering> <dtml-var content><br> </dtml-in>
Cliff
Ivan Stout wrote:
Greetings. I am trying to create an open source communal translation zope product thingy and have run into a snag. I had everything working, but then I realized that I needed to distinguish between what the language that the original document bein translated was in, which required passing an additional paramater to my query to gadfly. Well, this supposedly "broke the paramater chain" requiring me to explicitly add positional paramaters. The problem is, though I no longer get an error, no results are returned from my table. The paramaters are filtering the query, so I believe that my values are getting altered in some way that is causing them to not match anything. Here is what I suspect is causing me trouble . . .(the "----------------->" part):
<dtml-var name><br> <dtml-var doclang> <form action="parsegettranslation.py" method="get"> -----------> <dtml-in expr="gettransdoc(_.None,_,name='name',doclang='doclang')"> <br> <dtml-var ordering> <dtml-var content> <br>
Thanks! _______________________________________________ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
_______________________________________________ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
For a simple test I created this query (named BTestSQL and using MySQL, although that should not matter): Arguments doclang name select * from Document where doclang=<dtml-sqlvar doclang type=string> and name=<dtml-sqlvar name type=string> and this DTML Method: <dtml-var standard_html_header> <p>Start of output</p> <dtml-if name><dtml-if doclang> <dtml-in BTestZSQL> <a href="AnotherPage?SerialNo=<dtml-var SerialNo>"><dtml-var SerialNo>: <dtml-var content></a> <br> </dtml-in> </dtml-if></dtml-if> <p>End of output</p> <a href="<dtml-var getId>?name=Cliff&doclang=English">Test</a> <dtml-var standard_html_footer> Notice that if the parameters are being passed to the DTML Method you don't need to put them in the call to the query. OK, so viewing the DTML method gives you a link with some default parameters. Clicking the link gives you a list of matching records, each as a link to another form to do the translation - using a record no. It is not clear from your previous posts whether you sequence is breaking down when generating the list of objects to be translated, or at the translations stage. In addition to checking the Error Log to find which line of which object triggers the error you should test the ZSQL Method. Database errors can sometimes cause misleading errors elsewhere. HTH Cliff Ivan Stout wrote:
Cliff,
Thanks, but I am still having trouble (even after changing variable names, cases) . . . let me explain more what I am trying to do.
1) I have a table called Document (doclang, ordering, content, submitdate, name, submitter)
2) A document (say "GPL") gets broken down and inserted into the Document table, one sentence at a time.
3) A DTML Method uses a Z SQL method to create a list of what documents are in Document and creates URLs to form_for_translation (DTML Method) with "?name=<dtml-var doclang>&doclang=<dtml-var doclang>" added on the end. (Note: Is there a better way to create a list of links that passes paramaters to a DTML method when clicked?)
4) When a link is clicked the 2 paramaters get passed to form_for_translation, which passes them to a Z SQL method that queries the Document table, allowing form_for_translation to create a form that displays each sentece.
This all worked when I was only passing one paramater ("name"), but being able to keep track documents in different languages (with "doclang") would be a great feature. However, adding doclang causes the "ambigous" error . . .
On Fri, 11 Mar 2005 08:26:19 +0000, Cliff Ford <Cliff.Ford@ed.ac.uk> wrote:
In the call to the ZSQL Method, in doclang=doclang the first doclang is the name of the variable declared in the ZSQL method and the second doclang is the content of the variable with that name in the DTML Method. So if you put the second doclang in quotes you pas the string 'doclang' rather than the content of the doclang variable. That explains why the latter does not cause an error but returns no results. It is often less confusing to use different names for the argument name and value, for example DocLangField=testLanguage (or docLangField='English').
The error value you have quoted (Error Value: 'DOCLANG':) suggests the problem may be case sensitivity. Check that the case of the Database Field that you are testing matches the case of the name you are passing to the query. One gotcha to be aware of is that some databases accept field names in any case but return field names in upper case. For example, you may be able to do this:
select * from table where doclang is not null
but find that the return field name is DOCLANG. Not sure if this is relevant in this case.
Cliff
Ivan Stout wrote:
Dieter,
Thanks, it is a Z SQL method . . . I will get rid of the positional place holders.
Cliff,
Thanks for the response.
I did the following:
DTML METHOD file:
<html> <dtml-var name><br> <dtml-var doclang> <form action="parsegettranslation.py" method="get"> <dtml-in expr="gettransdoc(name=name,doclang=doclang)"> #changed here <br> <dtml-var ordering> <dtml-var content>
gettransdoc Z SQL Method file:
(ARGUMENTS:name doclang)
select * from document where name=<dtml-sqlvar name type=string> and doclang=<dtml-sqlvar doclang type=string>
This is what I get:
"Error Type: NameError Error Value: 'DOCLANG': ambiguous or unknown attribute"
However, if I add a single quote to the DTML Method, like this: <dtml-in expr="gettransdoc(name='name',doclang='doclang')">
I do not get an error, but I do not get my query results either . . . Are the single quotes getting literally passed to the query or something?
On Thu, 10 Mar 2005 22:11:58 +0000, Cliff Ford <Cliff.Ford@ed.ac.uk> wrote:
It is not clear to me why you would pass None parameters to a select query. Typically your query would have named arguments (name and doclang) like this:
select * from yourTable where name=<dtml-sqlvar name type=string> and doclang=<dtml-sqlvar doclang type=string>
Leave out the last line if you don't want to select and doclang.
Then call the query like this:
<dtml-in expr="gettransdoc(name=name,doclang=doclang)"> <dtml-var ordering> <dtml-var content><br> </dtml-in>
Cliff
Ivan Stout wrote:
Greetings. I am trying to create an open source communal translation zope product thingy and have run into a snag. I had everything working, but then I realized that I needed to distinguish between what the language that the original document bein translated was in, which required passing an additional paramater to my query to gadfly. Well, this supposedly "broke the paramater chain" requiring me to explicitly add positional paramaters. The problem is, though I no longer get an error, no results are returned from my table. The paramaters are filtering the query, so I believe that my values are getting altered in some way that is causing them to not match anything. Here is what I suspect is causing me trouble . . .(the "----------------->" part):
<dtml-var name><br> <dtml-var doclang> <form action="parsegettranslation.py" method="get"> -----------> <dtml-in expr="gettransdoc(_.None,_,name='name',doclang='doclang')"> <br> <dtml-var ordering> <dtml-var content> <br>
Thanks! _______________________________________________ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
_______________________________________________ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
_______________________________________________ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
_______________________________________________ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Dieter, here is the traceback, please help me interpret it. "Traceback (innermost last): Module ZPublisher.Publish, line 101, in publish Module ZPublisher.mapply, line 88, in mapply Module ZPublisher.Publish, line 39, in call_object Module OFS.DTMLMethod, line 144, in __call__ - <DTMLMethod instance at 0189E410> - URL: http://tel040302aa.asia.tel.com:8080/ttb/silknet/form_for_translation/manage... - Physical Path: /ttb/silknet/form_for_translation Module DocumentTemplate.DT_String, line 474, in __call__ Module DocumentTemplate.DT_In, line 703, in renderwob Module DocumentTemplate.DT_In, line 626, in renderwob Module DocumentTemplate.DT_Util, line 198, in eval - __traceback_info__: doc Module <string>, line 1, in <expression> Module Shared.DC.ZRDB.DA, line 454, in __call__ - <SQL instance at 0189E2F0> Module Products.ZGadflyDA.db, line 108, in query Module Products.ZGadflyDA.gadfly.gadfly, line 349, in execute Module Products.ZGadflyDA.gadfly.sqlsem, line 2641, in relbind Module Products.ZGadflyDA.gadfly.sqlsem, line 1359, in relbind Module Products.ZGadflyDA.gadfly.sqlsem, line 398, in relbind NameError: 'DOCLANG': ambiguous or unknown attribute" I have found the actual "sqlsem" but am not too familar with it. It appears to be just checking if paramaters have values or not, but I am probably wrong. . . Cliff, the problem appears to be occuring in just generating the form that will be used for the translation. I have been manually feeding paramaters by calling the translation_form with ?doc= . . . etc at the end, so I am pretty sure about this. The above Traceback has the path to "form_for_translation", which is the DTML method that calls the Z SQL method in order to create the form used in the translation. I keep on getting this error: Error Type: NameError Error Value: 'DOCLANG': ambiguous or unknown attribute But DOCLANG is now only used in the Z SQL method. I couldn't find any google reference to "ambiguous or unkown attribute" . . . Thanks, Ivan On Fri, 11 Mar 2005 23:24:09 +0000, Cliff Ford <Cliff.Ford@ed.ac.uk> wrote:
For a simple test I created this query (named BTestSQL and using MySQL, although that should not matter):
Arguments doclang name select * from Document where doclang=<dtml-sqlvar doclang type=string> and name=<dtml-sqlvar name type=string>
and this DTML Method:
<dtml-var standard_html_header> <p>Start of output</p> <dtml-if name><dtml-if doclang> <dtml-in BTestZSQL> <a href="AnotherPage?SerialNo=<dtml-var SerialNo>"><dtml-var SerialNo>: <dtml-var content></a> <br> </dtml-in> </dtml-if></dtml-if> <p>End of output</p> <a href="<dtml-var getId>?name=Cliff&doclang=English">Test</a> <dtml-var standard_html_footer>
Notice that if the parameters are being passed to the DTML Method you don't need to put them in the call to the query. OK, so viewing the DTML method gives you a link with some default parameters. Clicking the link gives you a list of matching records, each as a link to another form to do the translation - using a record no.
It is not clear from your previous posts whether you sequence is breaking down when generating the list of objects to be translated, or at the translations stage.
In addition to checking the Error Log to find which line of which object triggers the error you should test the ZSQL Method. Database errors can sometimes cause misleading errors elsewhere.
HTH
Cliff
Ivan Stout wrote:
Cliff,
Thanks, but I am still having trouble (even after changing variable names, cases) . . . let me explain more what I am trying to do.
1) I have a table called Document (doclang, ordering, content, submitdate, name, submitter)
2) A document (say "GPL") gets broken down and inserted into the Document table, one sentence at a time.
3) A DTML Method uses a Z SQL method to create a list of what documents are in Document and creates URLs to form_for_translation (DTML Method) with "?name=<dtml-var doclang>&doclang=<dtml-var doclang>" added on the end. (Note: Is there a better way to create a list of links that passes paramaters to a DTML method when clicked?)
4) When a link is clicked the 2 paramaters get passed to form_for_translation, which passes them to a Z SQL method that queries the Document table, allowing form_for_translation to create a form that displays each sentece.
This all worked when I was only passing one paramater ("name"), but being able to keep track documents in different languages (with "doclang") would be a great feature. However, adding doclang causes the "ambigous" error . . .
On Fri, 11 Mar 2005 08:26:19 +0000, Cliff Ford <Cliff.Ford@ed.ac.uk> wrote:
In the call to the ZSQL Method, in doclang=doclang the first doclang is the name of the variable declared in the ZSQL method and the second doclang is the content of the variable with that name in the DTML Method. So if you put the second doclang in quotes you pas the string 'doclang' rather than the content of the doclang variable. That explains why the latter does not cause an error but returns no results. It is often less confusing to use different names for the argument name and value, for example DocLangField=testLanguage (or docLangField='English').
The error value you have quoted (Error Value: 'DOCLANG':) suggests the problem may be case sensitivity. Check that the case of the Database Field that you are testing matches the case of the name you are passing to the query. One gotcha to be aware of is that some databases accept field names in any case but return field names in upper case. For example, you may be able to do this:
select * from table where doclang is not null
but find that the return field name is DOCLANG. Not sure if this is relevant in this case.
Cliff
Ivan Stout wrote:
Dieter,
Thanks, it is a Z SQL method . . . I will get rid of the positional place holders.
Cliff,
Thanks for the response.
I did the following:
DTML METHOD file:
<html> <dtml-var name><br> <dtml-var doclang> <form action="parsegettranslation.py" method="get"> <dtml-in expr="gettransdoc(name=name,doclang=doclang)"> #changed here <br> <dtml-var ordering> <dtml-var content>
gettransdoc Z SQL Method file:
(ARGUMENTS:name doclang)
select * from document where name=<dtml-sqlvar name type=string> and doclang=<dtml-sqlvar doclang type=string>
This is what I get:
"Error Type: NameError Error Value: 'DOCLANG': ambiguous or unknown attribute"
However, if I add a single quote to the DTML Method, like this: <dtml-in expr="gettransdoc(name='name',doclang='doclang')">
I do not get an error, but I do not get my query results either . . . Are the single quotes getting literally passed to the query or something?
On Thu, 10 Mar 2005 22:11:58 +0000, Cliff Ford <Cliff.Ford@ed.ac.uk> wrote:
It is not clear to me why you would pass None parameters to a select query. Typically your query would have named arguments (name and doclang) like this:
select * from yourTable where name=<dtml-sqlvar name type=string> and doclang=<dtml-sqlvar doclang type=string>
Leave out the last line if you don't want to select and doclang.
Then call the query like this:
<dtml-in expr="gettransdoc(name=name,doclang=doclang)"> <dtml-var ordering> <dtml-var content><br> </dtml-in>
Cliff
Ivan Stout wrote:
Greetings. I am trying to create an open source communal translation zope product thingy and have run into a snag. I had everything working, but then I realized that I needed to distinguish between what the language that the original document bein translated was in, which required passing an additional paramater to my query to gadfly. Well, this supposedly "broke the paramater chain" requiring me to explicitly add positional paramaters. The problem is, though I no longer get an error, no results are returned from my table. The paramaters are filtering the query, so I believe that my values are getting altered in some way that is causing them to not match anything. Here is what I suspect is causing me trouble . . .(the "----------------->" part):
<dtml-var name><br> <dtml-var doclang> <form action="parsegettranslation.py" method="get"> -----------> <dtml-in expr="gettransdoc(_.None,_,name='name',doclang='doclang')"> <br> <dtml-var ordering> <dtml-var content> <br>
Thanks! _______________________________________________ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
_______________________________________________ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
_______________________________________________ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
_______________________________________________ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
The last line of the Tracback tells you the error occurred in the ZGadflyDA Product. Note that it is rarely necessary for a User to poke around in Products - just look at what your own code is doing with the offending attribute (DOCLANG). I can reproduce you error by viewing a DTML script that calls a ZSQL Method that queries a Gadfly database table - by miss-spelling a parameter name. For example, if I declare the ZSQL Arguments as doclang and name and make the query: select * from Document where doclan=<dtml-sqlvar doclang type=string> and name=<dtml-sqlvar name type=string> Note the miss-spelling (doclan instead of doclang). Then I get exactly the traceback you see. But if I use the ZSQL Method Test Tab I get this message in the Test result: Error, exceptions.NameError: 'DOCLAN': ambiguous or unknown attribute Which says mor or less the same thing in this case. That is what I mean about testing the ZSQL Method. So you have to check that the arguments you are using actually exist as fields in the table you are using (Use the Gadfly connection object Browse button). Check that you are not accidentally querying a previous table that does not have a doclang field. Cliff Ivan Stout wrote:
Dieter, here is the traceback, please help me interpret it.
"Traceback (innermost last): Module ZPublisher.Publish, line 101, in publish Module ZPublisher.mapply, line 88, in mapply Module ZPublisher.Publish, line 39, in call_object Module OFS.DTMLMethod, line 144, in __call__ - <DTMLMethod instance at 0189E410> - URL: http://tel040302aa.asia.tel.com:8080/ttb/silknet/form_for_translation/manage... - Physical Path: /ttb/silknet/form_for_translation Module DocumentTemplate.DT_String, line 474, in __call__ Module DocumentTemplate.DT_In, line 703, in renderwob Module DocumentTemplate.DT_In, line 626, in renderwob Module DocumentTemplate.DT_Util, line 198, in eval - __traceback_info__: doc Module <string>, line 1, in <expression> Module Shared.DC.ZRDB.DA, line 454, in __call__ - <SQL instance at 0189E2F0> Module Products.ZGadflyDA.db, line 108, in query Module Products.ZGadflyDA.gadfly.gadfly, line 349, in execute Module Products.ZGadflyDA.gadfly.sqlsem, line 2641, in relbind Module Products.ZGadflyDA.gadfly.sqlsem, line 1359, in relbind Module Products.ZGadflyDA.gadfly.sqlsem, line 398, in relbind NameError: 'DOCLANG': ambiguous or unknown attribute"
I have found the actual "sqlsem" but am not too familar with it. It appears to be just checking if paramaters have values or not, but I am probably wrong. . .
Cliff, the problem appears to be occuring in just generating the form that will be used for the translation. I have been manually feeding paramaters by calling the translation_form with ?doc= . . . etc at the end, so I am pretty sure about this.
The above Traceback has the path to "form_for_translation", which is the DTML method that calls the Z SQL method in order to create the form used in the translation. I keep on getting this error:
Error Type: NameError Error Value: 'DOCLANG': ambiguous or unknown attribute
But DOCLANG is now only used in the Z SQL method. I couldn't find any google reference to "ambiguous or unkown attribute" . . .
Thanks,
Ivan
On Fri, 11 Mar 2005 23:24:09 +0000, Cliff Ford <Cliff.Ford@ed.ac.uk> wrote:
For a simple test I created this query (named BTestSQL and using MySQL, although that should not matter):
Arguments doclang name select * from Document where doclang=<dtml-sqlvar doclang type=string> and name=<dtml-sqlvar name type=string>
and this DTML Method:
<dtml-var standard_html_header> <p>Start of output</p> <dtml-if name><dtml-if doclang> <dtml-in BTestZSQL> <a href="AnotherPage?SerialNo=<dtml-var SerialNo>"><dtml-var SerialNo>: <dtml-var content></a> <br> </dtml-in> </dtml-if></dtml-if> <p>End of output</p> <a href="<dtml-var getId>?name=Cliff&doclang=English">Test</a> <dtml-var standard_html_footer>
Notice that if the parameters are being passed to the DTML Method you don't need to put them in the call to the query. OK, so viewing the DTML method gives you a link with some default parameters. Clicking the link gives you a list of matching records, each as a link to another form to do the translation - using a record no.
It is not clear from your previous posts whether you sequence is breaking down when generating the list of objects to be translated, or at the translations stage.
In addition to checking the Error Log to find which line of which object triggers the error you should test the ZSQL Method. Database errors can sometimes cause misleading errors elsewhere.
HTH
Cliff
Ivan Stout wrote:
Cliff,
Thanks, but I am still having trouble (even after changing variable names, cases) . . . let me explain more what I am trying to do.
1) I have a table called Document (doclang, ordering, content, submitdate, name, submitter)
2) A document (say "GPL") gets broken down and inserted into the Document table, one sentence at a time.
3) A DTML Method uses a Z SQL method to create a list of what documents are in Document and creates URLs to form_for_translation (DTML Method) with "?name=<dtml-var doclang>&doclang=<dtml-var doclang>" added on the end. (Note: Is there a better way to create a list of links that passes paramaters to a DTML method when clicked?)
4) When a link is clicked the 2 paramaters get passed to form_for_translation, which passes them to a Z SQL method that queries the Document table, allowing form_for_translation to create a form that displays each sentece.
This all worked when I was only passing one paramater ("name"), but being able to keep track documents in different languages (with "doclang") would be a great feature. However, adding doclang causes the "ambigous" error . . .
On Fri, 11 Mar 2005 08:26:19 +0000, Cliff Ford <Cliff.Ford@ed.ac.uk> wrote:
In the call to the ZSQL Method, in doclang=doclang the first doclang is the name of the variable declared in the ZSQL method and the second doclang is the content of the variable with that name in the DTML Method. So if you put the second doclang in quotes you pas the string 'doclang' rather than the content of the doclang variable. That explains why the latter does not cause an error but returns no results. It is often less confusing to use different names for the argument name and value, for example DocLangField=testLanguage (or docLangField='English').
The error value you have quoted (Error Value: 'DOCLANG':) suggests the problem may be case sensitivity. Check that the case of the Database Field that you are testing matches the case of the name you are passing to the query. One gotcha to be aware of is that some databases accept field names in any case but return field names in upper case. For example, you may be able to do this:
select * from table where doclang is not null
but find that the return field name is DOCLANG. Not sure if this is relevant in this case.
Cliff
Ivan Stout wrote:
Dieter,
Thanks, it is a Z SQL method . . . I will get rid of the positional place holders.
Cliff,
Thanks for the response.
I did the following:
DTML METHOD file:
<html> <dtml-var name><br> <dtml-var doclang> <form action="parsegettranslation.py" method="get"> <dtml-in expr="gettransdoc(name=name,doclang=doclang)"> #changed here <br> <dtml-var ordering> <dtml-var content>
gettransdoc Z SQL Method file:
(ARGUMENTS:name doclang)
select *
from document
where name=<dtml-sqlvar name type=string> and doclang=<dtml-sqlvar doclang type=string>
This is what I get:
"Error Type: NameError Error Value: 'DOCLANG': ambiguous or unknown attribute"
However, if I add a single quote to the DTML Method, like this: <dtml-in expr="gettransdoc(name='name',doclang='doclang')">
I do not get an error, but I do not get my query results either . . . Are the single quotes getting literally passed to the query or something?
On Thu, 10 Mar 2005 22:11:58 +0000, Cliff Ford <Cliff.Ford@ed.ac.uk> wrote:
It is not clear to me why you would pass None parameters to a select query. Typically your query would have named arguments (name and doclang) like this:
select * from yourTable where name=<dtml-sqlvar name type=string> and doclang=<dtml-sqlvar doclang type=string>
Leave out the last line if you don't want to select and doclang.
Then call the query like this:
<dtml-in expr="gettransdoc(name=name,doclang=doclang)"> <dtml-var ordering> <dtml-var content><br> </dtml-in>
Cliff
Ivan Stout wrote:
>Greetings. I am trying to create an open source communal translation >zope product thingy and have run into a snag. I had everything >working, but then I realized that I needed to distinguish between what >the language that the original document bein translated was in, which >required passing an additional paramater to my query to gadfly. Well, >this supposedly "broke the paramater chain" requiring me to explicitly >add positional paramaters. The problem is, though I no longer get an >error, no results are returned from my table. The paramaters are >filtering the query, so I believe that my values are getting altered >in some way that is causing them to not match anything. Here is what I >suspect is causing me trouble . . .(the "----------------->" part): > ><dtml-var name><br> ><dtml-var doclang> ><form action="parsegettranslation.py" method="get"> >-----------> <dtml-in >expr="gettransdoc(_.None,_,name='name',doclang='doclang')"> ><br> ><dtml-var ordering> <dtml-var content> ><br> > >Thanks! >_______________________________________________ >Zope maillist - Zope@zope.org >http://mail.zope.org/mailman/listinfo/zope >** No cross posts or HTML encoding! ** >(Related lists - >http://mail.zope.org/mailman/listinfo/zope-announce >http://mail.zope.org/mailman/listinfo/zope-dev )
_______________________________________________ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
_______________________________________________ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
_______________________________________________ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
_______________________________________________ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Cliff, you are awesome. Thank you very, very much! It turns out that it was actually a separate Z SQL method used in that same form (To fetch a summary of previously submitted translations and their associated rankings for each line of the document so that users can vote), that was causing the trouble. However, since that method queried a database that DID NOT have "doclang", I assumed it wasn't the problem . . . however the method tried to filter on "doclang" . . . so it WAS the problem. Oh, the irony. . .Thanks for pointing me to the right direction! Now, all I have to do is add some user tracking/management (one of the major reason I came to Zope), and I will be ready to unleash this thing to the wild. Thanks, again! Ivan On Tue, 15 Mar 2005 08:26:25 +0000, Cliff Ford <Cliff.Ford@ed.ac.uk> wrote:
The last line of the Tracback tells you the error occurred in the ZGadflyDA Product. Note that it is rarely necessary for a User to poke around in Products - just look at what your own code is doing with the offending attribute (DOCLANG).
I can reproduce you error by viewing a DTML script that calls a ZSQL Method that queries a Gadfly database table - by miss-spelling a parameter name. For example, if I declare the ZSQL Arguments as doclang and name and make the query:
select * from Document where doclan=<dtml-sqlvar doclang type=string> and name=<dtml-sqlvar name type=string>
Note the miss-spelling (doclan instead of doclang). Then I get exactly the traceback you see. But if I use the ZSQL Method Test Tab I get this message in the Test result:
Error, exceptions.NameError: 'DOCLAN': ambiguous or unknown attribute
Which says mor or less the same thing in this case. That is what I mean about testing the ZSQL Method. So you have to check that the arguments you are using actually exist as fields in the table you are using (Use the Gadfly connection object Browse button).
Check that you are not accidentally querying a previous table that does not have a doclang field.
Cliff
Ivan Stout wrote:
Dieter, here is the traceback, please help me interpret it.
"Traceback (innermost last): Module ZPublisher.Publish, line 101, in publish Module ZPublisher.mapply, line 88, in mapply Module ZPublisher.Publish, line 39, in call_object Module OFS.DTMLMethod, line 144, in __call__ - <DTMLMethod instance at 0189E410> - URL: http://tel040302aa.asia.tel.com:8080/ttb/silknet/form_for_translation/manage... - Physical Path: /ttb/silknet/form_for_translation Module DocumentTemplate.DT_String, line 474, in __call__ Module DocumentTemplate.DT_In, line 703, in renderwob Module DocumentTemplate.DT_In, line 626, in renderwob Module DocumentTemplate.DT_Util, line 198, in eval - __traceback_info__: doc Module <string>, line 1, in <expression> Module Shared.DC.ZRDB.DA, line 454, in __call__ - <SQL instance at 0189E2F0> Module Products.ZGadflyDA.db, line 108, in query Module Products.ZGadflyDA.gadfly.gadfly, line 349, in execute Module Products.ZGadflyDA.gadfly.sqlsem, line 2641, in relbind Module Products.ZGadflyDA.gadfly.sqlsem, line 1359, in relbind Module Products.ZGadflyDA.gadfly.sqlsem, line 398, in relbind NameError: 'DOCLANG': ambiguous or unknown attribute"
I have found the actual "sqlsem" but am not too familar with it. It appears to be just checking if paramaters have values or not, but I am probably wrong. . .
Cliff, the problem appears to be occuring in just generating the form that will be used for the translation. I have been manually feeding paramaters by calling the translation_form with ?doc= . . . etc at the end, so I am pretty sure about this.
The above Traceback has the path to "form_for_translation", which is the DTML method that calls the Z SQL method in order to create the form used in the translation. I keep on getting this error:
Error Type: NameError Error Value: 'DOCLANG': ambiguous or unknown attribute
But DOCLANG is now only used in the Z SQL method. I couldn't find any google reference to "ambiguous or unkown attribute" . . .
Thanks,
Ivan
On Fri, 11 Mar 2005 23:24:09 +0000, Cliff Ford <Cliff.Ford@ed.ac.uk> wrote:
For a simple test I created this query (named BTestSQL and using MySQL, although that should not matter):
Arguments doclang name select * from Document where doclang=<dtml-sqlvar doclang type=string> and name=<dtml-sqlvar name type=string>
and this DTML Method:
<dtml-var standard_html_header> <p>Start of output</p> <dtml-if name><dtml-if doclang> <dtml-in BTestZSQL> <a href="AnotherPage?SerialNo=<dtml-var SerialNo>"><dtml-var SerialNo>: <dtml-var content></a> <br> </dtml-in> </dtml-if></dtml-if> <p>End of output</p> <a href="<dtml-var getId>?name=Cliff&doclang=English">Test</a> <dtml-var standard_html_footer>
Notice that if the parameters are being passed to the DTML Method you don't need to put them in the call to the query. OK, so viewing the DTML method gives you a link with some default parameters. Clicking the link gives you a list of matching records, each as a link to another form to do the translation - using a record no.
It is not clear from your previous posts whether you sequence is breaking down when generating the list of objects to be translated, or at the translations stage.
In addition to checking the Error Log to find which line of which object triggers the error you should test the ZSQL Method. Database errors can sometimes cause misleading errors elsewhere.
HTH
Cliff
Ivan Stout wrote:
Cliff,
Thanks, but I am still having trouble (even after changing variable names, cases) . . . let me explain more what I am trying to do.
1) I have a table called Document (doclang, ordering, content, submitdate, name, submitter)
2) A document (say "GPL") gets broken down and inserted into the Document table, one sentence at a time.
3) A DTML Method uses a Z SQL method to create a list of what documents are in Document and creates URLs to form_for_translation (DTML Method) with "?name=<dtml-var doclang>&doclang=<dtml-var doclang>" added on the end. (Note: Is there a better way to create a list of links that passes paramaters to a DTML method when clicked?)
4) When a link is clicked the 2 paramaters get passed to form_for_translation, which passes them to a Z SQL method that queries the Document table, allowing form_for_translation to create a form that displays each sentece.
This all worked when I was only passing one paramater ("name"), but being able to keep track documents in different languages (with "doclang") would be a great feature. However, adding doclang causes the "ambigous" error . . .
On Fri, 11 Mar 2005 08:26:19 +0000, Cliff Ford <Cliff.Ford@ed.ac.uk> wrote:
In the call to the ZSQL Method, in doclang=doclang the first doclang is the name of the variable declared in the ZSQL method and the second doclang is the content of the variable with that name in the DTML Method. So if you put the second doclang in quotes you pas the string 'doclang' rather than the content of the doclang variable. That explains why the latter does not cause an error but returns no results. It is often less confusing to use different names for the argument name and value, for example DocLangField=testLanguage (or docLangField='English').
The error value you have quoted (Error Value: 'DOCLANG':) suggests the problem may be case sensitivity. Check that the case of the Database Field that you are testing matches the case of the name you are passing to the query. One gotcha to be aware of is that some databases accept field names in any case but return field names in upper case. For example, you may be able to do this:
select * from table where doclang is not null
but find that the return field name is DOCLANG. Not sure if this is relevant in this case.
Cliff
Ivan Stout wrote:
Dieter,
Thanks, it is a Z SQL method . . . I will get rid of the positional place holders.
Cliff,
Thanks for the response.
I did the following:
DTML METHOD file:
<html> <dtml-var name><br> <dtml-var doclang> <form action="parsegettranslation.py" method="get"> <dtml-in expr="gettransdoc(name=name,doclang=doclang)"> #changed here <br> <dtml-var ordering> <dtml-var content>
gettransdoc Z SQL Method file:
(ARGUMENTS:name doclang)
select *
from document
where name=<dtml-sqlvar name type=string> and doclang=<dtml-sqlvar doclang type=string>
This is what I get:
"Error Type: NameError Error Value: 'DOCLANG': ambiguous or unknown attribute"
However, if I add a single quote to the DTML Method, like this: <dtml-in expr="gettransdoc(name='name',doclang='doclang')">
I do not get an error, but I do not get my query results either . . . Are the single quotes getting literally passed to the query or something?
On Thu, 10 Mar 2005 22:11:58 +0000, Cliff Ford <Cliff.Ford@ed.ac.uk> wrote:
>It is not clear to me why you would pass None parameters to a select >query. Typically your query would have named arguments (name and >doclang) like this: > >select * from yourTable where name=<dtml-sqlvar name type=string> >and doclang=<dtml-sqlvar doclang type=string> > >Leave out the last line if you don't want to select and doclang. > >Then call the query like this: > ><dtml-in expr="gettransdoc(name=name,doclang=doclang)"> ><dtml-var ordering> <dtml-var content><br> ></dtml-in> > >Cliff > >Ivan Stout wrote: > > > >>Greetings. I am trying to create an open source communal translation >>zope product thingy and have run into a snag. I had everything >>working, but then I realized that I needed to distinguish between what >>the language that the original document bein translated was in, which >>required passing an additional paramater to my query to gadfly. Well, >>this supposedly "broke the paramater chain" requiring me to explicitly >>add positional paramaters. The problem is, though I no longer get an >>error, no results are returned from my table. The paramaters are >>filtering the query, so I believe that my values are getting altered >>in some way that is causing them to not match anything. Here is what I >>suspect is causing me trouble . . .(the "----------------->" part): >> >><dtml-var name><br> >><dtml-var doclang> >><form action="parsegettranslation.py" method="get"> >>-----------> <dtml-in >>expr="gettransdoc(_.None,_,name='name',doclang='doclang')"> >><br> >><dtml-var ordering> <dtml-var content> >><br> >> >>Thanks! >>_______________________________________________ >>Zope maillist - Zope@zope.org >>http://mail.zope.org/mailman/listinfo/zope >>** No cross posts or HTML encoding! ** >>(Related lists - >>http://mail.zope.org/mailman/listinfo/zope-announce >>http://mail.zope.org/mailman/listinfo/zope-dev ) > _______________________________________________ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
_______________________________________________ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
_______________________________________________ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
_______________________________________________ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Quoting Ivan Stout <aibanhamano@gmail.com>:
Greetings. I am trying to create an open source communal translation
>>zope product thingy
I just added to this mail list recently, because I maybe use zope to a project maybe similar to yours: create a web interface for anybody, computer-related or not, introduce their traducions basing in .po. I thought to integrate a zope web-based application created by me with a open source translation manager like KBabel. So, Zope goes well to it? (to integrate other open source applications, for example, and to manage applications with two texts, original and translation...) Thanks Jordi
Jordi, Personally, zope has made the web-interfacing so much easier for me (I am coming form attempting my entire project in LAMP . . . which was fun but soon became overwhelming when I made a mistake and had to figure out where). I think Zope allows newbie programmers, like myself, to generate better, more manageable code. So, in that respect, I can definitely recommend it. As a simple web interface to a .po file, Zope would be very easy to development on. However, there are already a couple similar projects that use different tools (http://translate.sourceforge.net/doc/tools-online_editors.html), so you may want to check those out first to see if you can modify them easily towards your needs. <shameless plug> For my humble project, I am attempting to (and have recently succeeded, thanks to this list) not only have a way for people to input translations, but also moderate prior translation sentences. The translation sentences that get the most relative mods actually get used. I am using a relational database, and each sentence in a separate record. I use two tables within Gadfly (the built-in Zope db) to do this. The idea is that anyone can stop by and just translate or vote on a couple sentences at a time, without even bothering with stuff that makes them look-up words in a dictionary. Hopefully, with enough of a diverse group, the group, as a whole, would not have to do any hard translation work. Some parts hard to everyone would remain, but then a "point system" should cover that. The user management support of Zope should allow me to more easily implement a "point" system that will reward users for submitting the correct translation and voting for the correct translation. With these points, users will be able to buy the right to post documents they wish to be translated into another language. Hopefully, with enough participates the system will be self-sustaining and will generate a lot of publicly available documents in other languages (I am hoping a lot of OSS documentation will get translated in different languages). Of course, it remains to be seen whether this will work or not, so I am eager to find out . . . <\shameless plug> Anyway, it depends on your needs, and if code exists elsewhere that will give you mostly what you want, then I would use that. However, I believe Zope greatly simplifies web development and have yet to find any downsides to it. So if you are doing a lot of the web-interface stuff on your own, then I would use Zope. On Tue, 15 Mar 2005 10:16:52 +0100, f2396576@est.fib.upc.edu <f2396576@est.fib.upc.edu> wrote:
Quoting Ivan Stout <aibanhamano@gmail.com>:
Greetings. I am trying to create an open source communal translation >>>zope product thingy
I just added to this mail list recently, because I maybe use zope to a project maybe similar to yours: create a web interface for anybody, computer-related or not, introduce their traducions basing in .po. I thought to integrate a zope web-based application created by me with a open source translation manager like KBabel.
So, Zope goes well to it? (to integrate other open source applications, for example, and to manage applications with two texts, original and translation...)
Thanks
Jordi _______________________________________________ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Ivan Stout wrote at 2005-3-15 13:14 +0900:
Dieter, here is the traceback, please help me interpret it. ... Module Products.ZGadflyDA.db, line 108, in query Module Products.ZGadflyDA.gadfly.gadfly, line 349, in execute Module Products.ZGadflyDA.gadfly.sqlsem, line 2641, in relbind Module Products.ZGadflyDA.gadfly.sqlsem, line 1359, in relbind Module Products.ZGadflyDA.gadfly.sqlsem, line 398, in relbind NameError: 'DOCLANG': ambiguous or unknown attribute"
You pass in a query to "gadfly" referencing "DOCLANG" and the corresponding table either does not have a field of that name or (less likely) has several after case normalization. The code near line 398 of "Products/ZGadflyDA.gadfly.sqlsem" will tell you more about how the check is made. -- Dieter
Ivan Stout wrote at 2005-3-11 15:33 +0900:
... This is what I get:
"Error Type: NameError Error Value: 'DOCLANG': ambiguous or unknown attribute"
The next essential lesson: You must look at the traceback (to be found in the ZMI's Root Folder --> "error_log")! It tells you where the exception was raised. You will need some time until you understand the tracebacks. Until then, you can post them to the list. I expect that the "doclang" access in "expr="gettransdoc(name=name,doclang=doclang)" caused the exception and that "doclang" comes from another database query with different spellings for "doclang". The traceback will settle this assumption... -- Dieter
participants (4)
-
Cliff Ford -
Dieter Maurer -
f2396576@est.fib.upc.edu -
Ivan Stout