Problem using nested dtml-in with zsql
Hi list After read http://plope.com/Books/2_7Edition/AppendixA.stx#2-19 I tried use two dtml-in for get information from zsql diferents, but say "This resource may be trying to reference a nonexistent object or variable *'x_var_region'* ." what is missing? The first dtml-in (prefix="q") only return one record. The second dtml-in return 12 records. [code] <dtml-in expr="zsql_taller( zregi=bregi, ztall=btall)" prefix="q"> <p> <form class="formulario" action="estado.html" id="main_form" name="main_form"> <input type="hidden" name="accion" value="insertar" /> <ul> <li><label for="bregi" class="titulo">REGION</label> <select id="bregi" name="bregi"> <dtml-in dime_region prefix="x"> <option value="<dtml-var x_var_region>" <--- Here try access tha variable <dtml-if expr="x_var_region==q_var_region">selected</dtml-if> > </option> </dtml-in> </select> </li> </ul> </form> <p> </dtml-in> -- ________________________________________ Lo bueno de vivir un dia mas es saber que nos queda un dia menos de vida
I found a litle solution using <dtml-var expr="q_item['region']"> (1) but why not work using <dtml-var q_var_region>? (1) http://marc.info/?l=zope-dev&m=103341051405194&w=2 2008/11/6 Miguel Beltran R. <yourpadre@gmail.com>
Hi list
After read http://plope.com/Books/2_7Edition/AppendixA.stx#2-19 I tried use two dtml-in for get information from zsql diferents, but say "This resource may be trying to reference a nonexistent object or variable * 'x_var_region'*."
what is missing?
The first dtml-in (prefix="q") only return one record. The second dtml-in return 12 records.
[code] <dtml-in expr="zsql_taller( zregi=bregi, ztall=btall)" prefix="q"> <p> <form class="formulario" action="estado.html" id="main_form" name="main_form"> <input type="hidden" name="accion" value="insertar" />
<ul> <li><label for="bregi" class="titulo">REGION</label> <select id="bregi" name="bregi"> <dtml-in dime_region prefix="x"> <option value="<dtml-var x_var_region>" <--- Here try access tha variable <dtml-if expr="x_var_region==q_var_region">selected</dtml-if> > </option> </dtml-in> </select> </li> </ul>
</form> <p> </dtml-in> -- ________________________________________ Lo bueno de vivir un dia mas es saber que nos queda un dia menos de vida
-- ________________________________________ Lo bueno de vivir un dia mas es saber que nos queda un dia menos de vida
Any particular reason for using DTML instead of ZPT? DTML is dead. -aj On 06.11.2008 20:53 Uhr, Miguel Beltran R. wrote:
Hi list
After read http://plope.com/Books/2_7Edition/AppendixA.stx#2-19 I tried use two dtml-in for get information from zsql diferents, but say "This resource may be trying to reference a nonexistent object or variable *'x_var_region'*."
what is missing?
The first dtml-in (prefix="q") only return one record. The second dtml-in return 12 records.
[code] <dtml-in expr="zsql_taller( zregi=bregi, ztall=btall)" prefix="q"> <p> <form class="formulario" action="estado.html" id="main_form" name="main_form"> <input type="hidden" name="accion" value="insertar" />
<ul> <li><label for="bregi" class="titulo">REGION</label> <select id="bregi" name="bregi"> <dtml-in dime_region prefix="x"> <option value="<dtml-var x_var_region>" <--- Here try access tha variable <dtml-if expr="x_var_region==q_var_region">selected</dtml-if>
</option> </dtml-in> </select> </li> </ul>
</form> <p> </dtml-in> -- ________________________________________ Lo bueno de vivir un dia mas es saber que nos queda un dia menos de vida
------------------------------------------------------------------------
_______________________________________________ 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 )
-- ZOPYX Ltd. & Co. KG - Charlottenstr. 37/1 - 72070 Tübingen - Germany Web: www.zopyx.com - Email: info@zopyx.com - Phone +49 - 7071 - 793376 Registergericht: Amtsgericht Stuttgart, Handelsregister A 381535 Geschäftsführer/Gesellschafter: ZOPYX Limited, Birmingham, UK ------------------------------------------------------------------------ E-Publishing, Python, Zope & Plone development, Consulting
On Saturday 08 November 2008 06:21, Andreas Jung wrote:
Any particular reason for using DTML instead of ZPT? DTML is dead. Firstly let me say that I do not wish to relight the ZPT vs DTML argument, only to make a few points.
I find this an extraordinary attitude coming from someone so important to this community. I am sure there are many developments out there relying on DTML and I am also sure that the developers are earning a living from those developments. Will employers be happy that the technology used for their sites is "dead" ? Will they continue to pay these developers? Can you give one reason why DTML is bad that is not based on personal preference, presentation tools or the cognitive ability of developers to understand where variables are coming from? Does it not work if used properly? If someone comes to Zope and prefers to use DTML then let him, don't criticise instead of help him. Zope is a fantastic piece of software, however it is used, and its use should be encouraged. I prefer DTML and always have done and always will, no matter what this list says and I am sure there are many more like me. DTML is available and is used, let's support it properly on this list. While I was learning Zope I had many questions, but I had to work most of them out myself, not wanting to get lambasted again on this list for using DTML. If help was more forthcoming I'm sure that I would have learned more quickly rather than in relative isolation. Is the ZMI going to be re-written using ZPT? Regards Garry
+1 cb -----Oorspronkelijk bericht----- Van: zope-bounces@zope.org [mailto:zope-bounces@zope.org] Namens Garry Saddington Verzonden: zaterdag 8 november 2008 12:54 Aan: zope@zope.org Onderwerp: Re: [Zope] Was Problem using nested dtml-in with zsql On Saturday 08 November 2008 06:21, Andreas Jung wrote:
Any particular reason for using DTML instead of ZPT? DTML is dead. Firstly let me say that I do not wish to relight the ZPT vs DTML argument, only to make a few points.
I find this an extraordinary attitude coming from someone so important to this community. I am sure there are many developments out there relying on DTML and I am also sure that the developers are earning a living from those developments. Will employers be happy that the technology used for their sites is "dead" ? Will they continue to pay these developers? Can you give one reason why DTML is bad that is not based on personal preference, presentation tools or the cognitive ability of developers to understand where variables are coming from? Does it not work if used properly? If someone comes to Zope and prefers to use DTML then let him, don't criticise instead of help him. Zope is a fantastic piece of software, however it is used, and its use should be encouraged. I prefer DTML and always have done and always will, no matter what this list says and I am sure there are many more like me. DTML is available and is used, let's support it properly on this list. While I was learning Zope I had many questions, but I had to work most of them out myself, not wanting to get lambasted again on this list for using DTML. If help was more forthcoming I'm sure that I would have learned more quickly rather than in relative isolation. Is the ZMI going to be re-written using ZPT? Regards Garry _______________________________________________ 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 ) No virus found in this incoming message. Checked by AVG - http://www.avg.com Version: 8.0.175 / Virus Database: 270.9.0/1775 - Release Date: 8-11-2008 9:56
+1 Well spoken. It is painful to see all the cheers for django templates when dtml has been around longer and is just as good, maybe better. ZPT may also be fantastic but I haven't needed them yet. They seem to be designed to solve web editing problems circa 2002. -Tim On Sat, Nov 8, 2008 at 11:47 AM, Kees de Brabander < cj.de.brabander@hccnet.nl> wrote:
+1 cb
-----Oorspronkelijk bericht----- Van: zope-bounces@zope.org [mailto:zope-bounces@zope.org] Namens Garry Saddington Verzonden: zaterdag 8 november 2008 12:54 Aan: zope@zope.org Onderwerp: Re: [Zope] Was Problem using nested dtml-in with zsql
On Saturday 08 November 2008 06:21, Andreas Jung wrote:
Any particular reason for using DTML instead of ZPT? DTML is dead. Firstly let me say that I do not wish to relight the ZPT vs DTML argument, only to make a few points.
I find this an extraordinary attitude coming from someone so important to this community. I am sure there are many developments out there relying on DTML and I am also sure that the developers are earning a living from those developments. Will employers be happy that the technology used for their sites is "dead" ? Will they continue to pay these developers?
Can you give one reason why DTML is bad that is not based on personal preference, presentation tools or the cognitive ability of developers to understand where variables are coming from? Does it not work if used properly?
If someone comes to Zope and prefers to use DTML then let him, don't criticise instead of help him. Zope is a fantastic piece of software, however it is used, and its use should be encouraged.
I prefer DTML and always have done and always will, no matter what this list says and I am sure there are many more like me. DTML is available and is used, let's support it properly on this list.
While I was learning Zope I had many questions, but I had to work most of them out myself, not wanting to get lambasted again on this list for using DTML. If help was more forthcoming I'm sure that I would have learned more quickly rather than in relative isolation.
Is the ZMI going to be re-written using ZPT?
Regards Garry _______________________________________________ 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 )
No virus found in this incoming message. Checked by AVG - http://www.avg.com Version: 8.0.175 / Virus Database: 270.9.0/1775 - Release Date: 8-11-2008 9:56
_______________________________________________ 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 )
BTW, Andreas, It is probably extra work to maintain both ZPT and DTML in each Zope release. We want you to know that we appreciate the extra work and your skills. :) On Sat, Nov 8, 2008 at 4:01 PM, Allen Schmidt Sr. < aschmidt@fredericksburg.com> wrote:
+++++111111111 We love zope on our site and continue to build new things almost daily and all with DTML and ZSQL. Not a single line of ZPT anywhere within our 7gb Data.fs that has been making us all money and employing many folks for almost 8 years now as a newspaper website. AND in the birthplace of Zope.... www.Fredericksburg.com/Virginia/ 8^)
Cheers! -Allen
Tim Nash wrote:
+1 Well spoken. It is painful to see all the cheers for django templates when dtml has been around longer and is just as good, maybe better.
ZPT may also be fantastic but I haven't needed them yet. They seem to be designed to solve web editing problems circa 2002.
-Tim
On Sat, Nov 8, 2008 at 11:47 AM, Kees de Brabander < cj.de.brabander@hccnet.nl> wrote:
+1 cb
-----Oorspronkelijk bericht----- Van: zope-bounces@zope.org [mailto:zope-bounces@zope.org] Namens Garry Saddington Verzonden: zaterdag 8 november 2008 12:54 Aan: zope@zope.org Onderwerp: Re: [Zope] Was Problem using nested dtml-in with zsql
On Saturday 08 November 2008 06:21, Andreas Jung wrote:
Any particular reason for using DTML instead of ZPT? DTML is dead. Firstly let me say that I do not wish to relight the ZPT vs DTML argument, only to make a few points.
I find this an extraordinary attitude coming from someone so important to this community. I am sure there are many developments out there relying on DTML and I am also sure that the developers are earning a living from those developments. Will employers be happy that the technology used for their sites is "dead" ? Will they continue to pay these developers?
Can you give one reason why DTML is bad that is not based on personal preference, presentation tools or the cognitive ability of developers to understand where variables are coming from? Does it not work if used properly?
If someone comes to Zope and prefers to use DTML then let him, don't criticise instead of help him. Zope is a fantastic piece of software, however it is used, and its use should be encouraged.
I prefer DTML and always have done and always will, no matter what this list says and I am sure there are many more like me. DTML is available and is used, let's support it properly on this list.
While I was learning Zope I had many questions, but I had to work most of them out myself, not wanting to get lambasted again on this list for using DTML. If help was more forthcoming I'm sure that I would have learned more quickly rather than in relative isolation.
Is the ZMI going to be re-written using ZPT?
Regards Garry _______________________________________________ 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 )
No virus found in this incoming message. Checked by AVG - http://www.avg.com Version: 8.0.175 / Virus Database: 270.9.0/1775 - Release Date: 8-11-2008 9:56
_______________________________________________ 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.orghttp://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 )
On Saturday 08 November 2008 21:59, Tim Nash wrote:
+1 Well spoken. It is painful to see all the cheers for django templates when dtml has been around longer and is just as good, maybe better. Just had a look. They do the same as dtml but with less functionality. Amusing that something that is dead in one system is the best thing since sliced bread in another! I too appreciate all the work that goes into maintaining Zope, thanks Andreas, long may you continue your contributions. Regards Garry
On 09.11.2008 12:17 Uhr, Garry Saddington wrote:
On Saturday 08 November 2008 21:59, Tim Nash wrote:
+1 Well spoken. It is painful to see all the cheers for django templates when dtml has been around longer and is just as good, maybe better. Just had a look. They do the same as dtml but with less functionality. Amusing that something that is dead in one system is the best thing since sliced bread in another! I too appreciate all the work that goes into maintaining Zope, thanks Andreas, long may you continue your contributions.
Guys, please calm down :-) Nobody told you that we are going to take DTML away. The point is pretty easy: if you are new to Zope then there is very little reason to get in touch with DTML (other than for ZSQL methods). ZPT is recommendation for generating markup for years. It is well maintained and documented and adopted. We should not throw newbies into the DTML hell - if you use it for legacy reasons or whatever reason, fine. The official message for newbies is likely: use ZPT. Andreas
The application is already designed with dtml. This is a little change. Before I rename it the fields in zsql to avoid conflicts. 2008/11/8 Andreas Jung <lists@zopyx.com>
Any particular reason for using DTML instead of ZPT? DTML is dead.
-aj
On 06.11.2008 20:53 Uhr, Miguel Beltran R. wrote:
Hi list
After read http://plope.com/Books/2_7Edition/AppendixA.stx#2-19 I tried use two dtml-in for get information from zsql diferents, but say "This resource may be trying to reference a nonexistent object or variable *'x_var_region'*."
what is missing?
The first dtml-in (prefix="q") only return one record. The second dtml-in return 12 records.
[code] <dtml-in expr="zsql_taller( zregi=bregi, ztall=btall)" prefix="q"> <p> <form class="formulario" action="estado.html" id="main_form" name="main_form"> <input type="hidden" name="accion" value="insertar" />
<ul> <li><label for="bregi" class="titulo">REGION</label> <select id="bregi" name="bregi"> <dtml-in dime_region prefix="x"> <option value="<dtml-var x_var_region>" <--- Here try access tha variable <dtml-if expr="x_var_region==q_var_region">selected</dtml-if>
</option> </dtml-in> </select> </li> </ul>
</form> <p> </dtml-in> -- ________________________________________ Lo bueno de vivir un dia mas es saber que nos queda un dia menos de vida
------------------------------------------------------------------------
_______________________________________________ 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 )
-- ZOPYX Ltd. & Co. KG - Charlottenstr. 37/1 - 72070 Tübingen - Germany Web: www.zopyx.com - Email: info@zopyx.com - Phone +49 - 7071 - 793376 Registergericht: Amtsgericht Stuttgart, Handelsregister A 381535 Geschäftsführer/Gesellschafter: ZOPYX Limited, Birmingham, UK ------------------------------------------------------------------------ E-Publishing, Python, Zope & Plone development, Consulting
-- ________________________________________ Lo bueno de vivir un dia mas es saber que nos queda un dia menos de vida
I resolve my problem modifying file C:\Zope\2.11.1\Zope\lib\python\DocumentTemplate\DT_InSV.py Method __getitem__ Changing if l < 0: alt_prefix = self.alt_prefix if not (alt_prefix and key.startswith(alt_prefix)): raise KeyError, key suffix = key[len(alt_prefix):].replace('_', '-') if '-' in suffix: try: return self[suffix] except KeyError: pass prefix = 'sequence' key = 'sequence-' + suffix else: suffix=key[l+1:] prefix=key[:l] TO if l < 0: alt_prefix = self.alt_prefix if not (alt_prefix and key.startswith(alt_prefix)): raise KeyError, key suffix = key[len(alt_prefix):].replace('_', '-', 1) <---- changed to just one time replace #too my variable have a '_' and is bad replace #if '-' in suffix: <-- what do it? the original suffix always have '-' # try: return self[suffix] # except KeyError: pass prefix = 'sequence' key = 'sequence-' + suffix try:return self[key] <-- the difference with the return above is what suffix except KeyError: pass #have 'var-region_nombre and here is 'sequence-var-region_region' else: suffix=key[l+1:] prefix=key[:l] All work fine until now 2008/11/10 Miguel Beltran R. <yourpadre@gmail.com>
The application is already designed with dtml. This is a little change. Before I rename it the fields in zsql to avoid conflicts.
2008/11/8 Andreas Jung <lists@zopyx.com>
Any particular reason for using DTML instead of ZPT? DTML is dead.
-aj
On 06.11.2008 20:53 Uhr, Miguel Beltran R. wrote:
Hi list
After read http://plope.com/Books/2_7Edition/AppendixA.stx#2-19 I tried use two dtml-in for get information from zsql diferents, but say "This resource may be trying to reference a nonexistent object or variable *'x_var_region'*."
what is missing?
The first dtml-in (prefix="q") only return one record. The second dtml-in return 12 records.
[code] <dtml-in expr="zsql_taller( zregi=bregi, ztall=btall)" prefix="q"> <p> <form class="formulario" action="estado.html" id="main_form" name="main_form"> <input type="hidden" name="accion" value="insertar" />
<ul> <li><label for="bregi" class="titulo">REGION</label> <select id="bregi" name="bregi"> <dtml-in dime_region prefix="x"> <option value="<dtml-var x_var_region>" <--- Here try access tha variable <dtml-if expr="x_var_region==q_var_region">selected</dtml-if>
</option> </dtml-in> </select> </li> </ul>
</form> <p> </dtml-in> -- ________________________________________ Lo bueno de vivir un dia mas es saber que nos queda un dia menos de vida
------------------------------------------------------------------------
_______________________________________________ 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 )
-- ZOPYX Ltd. & Co. KG - Charlottenstr. 37/1 - 72070 Tübingen - Germany Web: www.zopyx.com - Email: info@zopyx.com - Phone +49 - 7071 - 793376 Registergericht: Amtsgericht Stuttgart, Handelsregister A 381535 Geschäftsführer/Gesellschafter: ZOPYX Limited, Birmingham, UK ------------------------------------------------------------------------ E-Publishing, Python, Zope & Plone development, Consulting
-- ________________________________________ Lo bueno de vivir un dia mas es saber que nos queda un dia menos de vida
-- ________________________________________ Lo bueno de vivir un dia mas es saber que nos queda un dia menos de vida
participants (6)
-
Allen Schmidt Sr. -
Andreas Jung -
Garry Saddington -
Kees de Brabander -
Miguel Beltran R. -
Tim Nash