Re: [Zope] dtml-except

2010-10-04 Thread Jaroslav Lukesh
- Puvodní zpráva - 
Od: larrymcdonn...@att.net
Komu: zope@zope.org
Odesláno: 4. ríjna 2010 21:57
Predmet: [Zope] dtml-except


 Hi,

 I need the old timers to help with a zope dtml-try/dtml-except conditions. 
 I am using Zope 2.6.1. My problem is as follows:

 dtml-if expr=fluency_temp''
 fluency - dtml-var fluency_temp**

 dtml-call REQUEST.set('fluency_test', fluency_temp)

 dtml-call string_to_int(fluency_test ,REQUEST)
 dtml-try

 dtml-call REQUEST.set('fluency', y)

 dtml-except ValueError

 dtml-call REQUEST.set('name_error', 'error')

 dtml-if expr=name_error=='error'

 Invalid Number entered
 a href=../prek_4_dra_scoring_system/display_student 
 Click here to go back/a

 dtml-else

 dtml-call REQUEST.set('student_full_name', student_full_name)
 dtml-call REQUEST.set('dra', dra_temp)
  dtml-call REQUEST.set('date_scored', ZopeTime())
 dtml-call REQUEST.set('fluency', fluency)

dtml-call expr=update_dra_edl_score_1_4_record_eng(REQUEST)

 /dtml-if
 /dtml-try

 /dtml-if
 /dtml-in
 /dtml-if

 I will see an error if I enter a letter and not a number -

 Exception Type ValueError
 Exception Value invalid literal for int(): a



fluency - dtml-var fluency_temp missing=N/A null=N/A**

dtml-try

dtml-call REQUEST.set('fluency_test', _.int(fluency_temp))

dtml-call REQUEST.set('fluency', y)

dtml-call REQUEST.set('student_full_name', student_full_name)
dtml-call REQUEST.set('dra', dra_temp)
dtml-call REQUEST.set('date_scored', ZopeTime())
dtml-call REQUEST.set('fluency', fluency)


??? what you want to do with this ???
dtml-call expr=update_dra_edl_score_1_4_record_eng(REQUEST)
??? what you want to do with this ???

dtml-except ValueError

dtml-call REQUEST.set('name_error', 'error')

Invalid Number entered
a href=../prek_4_dra_scoring_system/display_student 
Click here to go back/a

/dtml-try


___
Zope maillist  -  Zope@zope.org
https://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] dtml-in pagination

2009-04-10 Thread Dieter Maurer
Bobby wrote at 2009-4-7 09:58 -0700:
  td colspan=3
   a href=?table=dtml-var tableorder_by=dtml-var 
 order_bysort=dtml-var sortstart=dtml-var 
 previous-sequenceprevious/a
   a href=?table=dtml-var tableorder_by=dtml-var 
 order_bysort=dtml-var sortstart=dtml-var next-sequencenext/a
  /td
/tr
/dtml-if sequence-end 
   
/dtml-in

Not sure, whether you will find it useful.
But, you may have a look at 
http://www.handshake.de/~dieter/pyprojects/zope/book/chap3.html#c37ac15c14b4;.
Search there for 4.3.5.2.3. Batch control.



-- 
Dieter
___
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 )


Re: [Zope] dtml-in pagination

2009-04-08 Thread Jeff Peterson
dtml-if REQUEST.has_key('b_start')
  dtml-call REQUEST.set('b_start',_.int(b_start))
dtml-else
  dtml-call REQUEST.set('b_start',0)
/dtml-if
dtml-call REQUEST.set('size', 3)
dtml-call REQUEST.set('foods',['sandwiches', 'pie', 'meatloaf', 
 'berries', 'bread', 'coffee', 
 'some', 'thing', 'else'])

a href=?b_start=dtml-var b_start-sizePrevious dtml-var size/a
dtml-in foods size=size orphan=1 start=b_start


  p
  dtml-var sequence-item
  /p

/dtml-in
a href=?b_start=dtml-var b_start+sizeNext dtml-var size/a

From: http://www.zope.org/Members/peterbe/DTML2ZPT/

Incidently, this is a great resource for moving from DTML to page templates.

There are many examples of batching on ZopeLabs as well, from what I could see 
they are for ZPT though.

http://www.zopelabs.com

--
Jeffrey D Peterson
Webmaster
Crary Industries, Inc.


-Original Message-
From: zope-boun...@zope.org [mailto:zope-boun...@zope.org] On Behalf Of Bobby
Sent: Tuesday, April 07, 2009 2:48 PM
To: zope@zope.org
Subject: Re: [Zope] dtml-in pagination


Could someone point me to some documentation on how to do pagination? Thanks. 


--- On Tue, 4/7/09, Bobby cybercruis...@yahoo.com wrote:

 From: Bobby cybercruis...@yahoo.com
 Subject: [Zope] dtml-in pagination
 To: zope@zope.org
 Date: Tuesday, April 7, 2009, 10:58 AM
 Hi,
 
 I'm trying to do pagination with dtml-in; could one of
 you show my why i can't get the next and previous button
 from my code below to work? 
 
 Also, i need to do view per page: 1,2,3,etc. and allow the
 user select the number of records displayed per page (size)
 as well. Thanks in advance for any advice. 
 
 dtml-in
 getTable(table=table,order_by=order_by,sort=sort)
 size=10 start=0
 dtml-if sequence-end
 tr
   td colspan=3
   a href=?table=dtml-var
 tableorder_by=dtml-var
 order_bysort=dtml-var
 sortstart=dtml-var
 previous-sequenceprevious/a
   a href=?table=dtml-var
 tableorder_by=dtml-var
 order_bysort=dtml-var
 sortstart=dtml-var
 next-sequencenext/a
   /td
 /tr
 /dtml-if sequence-end 

 /dtml-in
 
 
   
 ___
 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 )


Re: [Zope] dtml-in pagination

2009-04-07 Thread Bobby

Could someone point me to some documentation on how to do pagination? Thanks. 


--- On Tue, 4/7/09, Bobby cybercruis...@yahoo.com wrote:

 From: Bobby cybercruis...@yahoo.com
 Subject: [Zope] dtml-in pagination
 To: zope@zope.org
 Date: Tuesday, April 7, 2009, 10:58 AM
 Hi,
 
 I'm trying to do pagination with dtml-in; could one of
 you show my why i can't get the next and previous button
 from my code below to work? 
 
 Also, i need to do view per page: 1,2,3,etc. and allow the
 user select the number of records displayed per page (size)
 as well. Thanks in advance for any advice. 
 
 dtml-in
 getTable(table=table,order_by=order_by,sort=sort)
 size=10 start=0
 dtml-if sequence-end
 tr
   td colspan=3
   a href=?table=dtml-var
 tableorder_by=dtml-var
 order_bysort=dtml-var
 sortstart=dtml-var
 previous-sequenceprevious/a
   a href=?table=dtml-var
 tableorder_by=dtml-var
 order_bysort=dtml-var
 sortstart=dtml-var
 next-sequencenext/a
   /td
 /tr
 /dtml-if sequence-end 

 /dtml-in
 
 
   
 ___
 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 )


Re: [Zope] dtml-in

2009-04-02 Thread Bobby
that works, thanks. 

--- On Wed, 4/1/09, Andreas Jung li...@zopyx.com wrote:
From: Andreas Jung li...@zopyx.com
Subject: Re: [Zope] dtml-in
To: cybercruis...@yahoo.com
Cc: zope@zope.org
Date: Wednesday, April 1, 2009, 10:56 PM

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 02.04.2009 5:20 Uhr, Bobby wrote:
 Hi,
 
 I have a variable called checkGroup where its values are the
record ids that the user selected to be deleted. I have a deleteRecord method
that takes two arguements, one the sql table and the record id to be deleted.
The code below works fine except for when the user only select one item from the
checkGroup list, I get an error string not allow in in. Any
suggestions of how I could fix this? Thanks.   
 
 dtml-in checkGroup
   dtml-let deleteItem=sequence-item
 dtml-var deletedRecord(table,deleteItem)
   /dtml-let
 /dtml-in


Trible check that your form parameters use the ':list' directive within
the NAME attributes (check with the Zope Book (docs.zope.org).

- -akj
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.9 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAknURWAACgkQCJIWIbr9KYyepgCcCv5yINX6+DenO0SayWY3HnML
Jo8AoOlY7ykeWzI/g2jPfklXUVy5wgIS
=L0Im
-END PGP SIGNATURE-



  ___
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 )


Re: [Zope] dtml-in

2009-04-01 Thread Andreas Jung
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 02.04.2009 5:20 Uhr, Bobby wrote:
 Hi,
 
 I have a variable called checkGroup where its values are the record ids 
 that the user selected to be deleted. I have a deleteRecord method that takes 
 two arguements, one the sql table and the record id to be deleted. The code 
 below works fine except for when the user only select one item from the 
 checkGroup list, I get an error string not allow in in. Any suggestions of 
 how I could fix this? Thanks.   
 
 dtml-in checkGroup
   dtml-let deleteItem=sequence-item
 dtml-var deletedRecord(table,deleteItem)
   /dtml-let
 /dtml-in


Trible check that your form parameters use the ':list' directive within
the NAME attributes (check with the Zope Book (docs.zope.org).

- -akj
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.9 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAknURWAACgkQCJIWIbr9KYyepgCcCv5yINX6+DenO0SayWY3HnML
Jo8AoOlY7ykeWzI/g2jPfklXUVy5wgIS
=L0Im
-END PGP SIGNATURE-
begin:vcard
fn:Andreas Jung
n:Jung;Andreas
org:ZOPYX Ltd.  Co. KG
adr;quoted-printable:;;Charlottenstr. 37/1;T=C3=BCbingen;;72070;Germany
email;internet:i...@zopyx.com
title:CEO
tel;work:+49-7071-793376
tel;fax:+49-7071-7936840
tel;home:+49-7071-793257
x-mozilla-html:FALSE
url:www.zopyx.com
version:2.1
end:vcard

___
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 )


Re: [Zope] dtml-tree documentation

2008-05-27 Thread Tim Nash
http://www.zope.org/Members/anthony/tree-coding-tricks

and

http://www.zope.org/Members/cybertad/how_to/working_with_tree


 Where can I find out about this 'advanced usage'?
 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 )


Re: [Zope] dtml-tree documentation

2008-05-26 Thread Stefan H. Holek

http://www.zope.org/Documentation/Guides/DTML-HTML/DTML.15.html

On 25.05.2008, at 16:54, Garry Saddington wrote:


Is there a complete documentation of the dtml-tree tag anywhere?


--
Stefan H. Holek
[EMAIL PROTECTED]




___
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 )


Re: [Zope] dtml-tree documentation

2008-05-25 Thread Andreas Jung



--On 25. Mai 2008 15:54:58 +0100 Garry Saddington 
[EMAIL PROTECTED] wrote:



Is there a complete documentation of the dtml-tree tag anywhere?
The dtml reference of the Zope book has the following for some options:
This attribute is for advanced usage only
Where can I find out about this 'advanced usage'?


Using DTML and related DTML tags is like driving a SUV in the time
of climate change.

Better look a ZopeTree or something similar (I think there was something 
like SimpleTree - Google).


If you have still three good reasons for using DTML: check with The Zope 
Book 2.7 edition.


-aj



pgp8Hkzvf2Y86.pgp
Description: PGP signature
___
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 )


Re: [Zope] dtml-tree - change icons

2007-11-23 Thread Sascha Welter
(Wed, Nov 21, 2007 at 07:10:32PM +0100) Dieter Maurer wrote/schrieb/egrapse:
  However, I was told that there is a better tree package (forgot
  its name).

We're using ExpansionTree, which is ages-old, but it works. Maybe that
was the name you were looking for.

Regards,

Sascha

___
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 )


Re: [Zope] dtml-tree - change icons

2007-11-21 Thread Dieter Maurer
Ulla Theiss wrote at 2007-11-21 15:52 +0100:
 ...
we are using the dtml-tree - and we need other pictures for the plus and 
the minus symbol. How can we change them?

The code does not support to change the plus and minus symbols.

Your options:

  *  You change the code (-- TreeDisplay.TreeTag.tpRenderTABLE)

  *  You use monkey patching to redefine p_/mi and p_/pl
 (this will have global effect, of course)

  *  You forget about dtml-tree and use a Page Template based
 tree package.

 ZTUtils.Tree contains such a package and Page Templates
 contains an example how to use it.

 However, I was told that there is a better tree package (forgot
 its name).


A long time ago, I went for option 3.



-- 
Dieter
___
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 )


Re: [Zope] dtml method contents

2007-08-30 Thread Peter Bengtsson



garry saddington wrote:

I found this method on Zopelabs to get the contents of all ZSQL methods.

dtml-in ZopeFind(restrictedTraverse(['']), obj_metatypes=['DTML
Method'], search_sub=1)
  h2dtml.-id; (dtml.-title_or_id;)/h2
  pidtml-var absolute_url/i/p
  blockquotepredtml-var template/pre/blockquote
 
/dtml-in


Is it possible to do the same with all dtml methods? I have tried
replacing template with document_src but this gives a mixture of
part rendered methods and error messages which is completely jumbled.
Have you tried dtml-var document_src() instead of dtml-var 
document_src?



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 )



--
Peter Bengtsson,
work www.fry-it.com
home www.peterbe.com
hobby www.issuetrackerproduct.com
___
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 )


Re: [Zope] dtml method contents

2007-08-30 Thread Dieter Maurer
garry saddington wrote at 2007-8-30 15:46 +0100:
I found this method on Zopelabs to get the contents of all ZSQL methods.

dtml-in ZopeFind(restrictedTraverse(['']), obj_metatypes=['DTML
Method'], search_sub=1)
  h2dtml.-id; (dtml.-title_or_id;)/h2
  pidtml-var absolute_url/i/p
  blockquotepredtml-var template/pre/blockquote
 
/dtml-in

Is it possible to do the same with all dtml methods? I have tried
replacing template with document_src but this gives a mixture of
part rendered methods and error messages which is completely jumbled.

What is the . in dtml.-? In may memory, the . where
somewhere else (but I do not use DTML for a long time).

Anyway:

  Use the prefix attribute of dtml-in and replace your
  template above with yourPrefix_item.

  ATT: keep the ... around; otherwise, the errors will stay.



-- 
Dieter
___
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 )


Re: [Zope] dtml method contents

2007-08-30 Thread garry saddington
On Thu, 2007-08-30 at 19:31 +0100, garry saddington wrote:
 On Thu, 2007-08-30 at 18:44 +0100, Peter Bengtsson wrote:
  
  garry saddington wrote:
   I found this method on Zopelabs to get the contents of all ZSQL methods.
   
   dtml-in ZopeFind(restrictedTraverse(['']), obj_metatypes=['DTML
   Method'], search_sub=1)
 h2dtml.-id; (dtml.-title_or_id;)/h2
 pidtml-var absolute_url/i/p
 blockquotepredtml-var template/pre/blockquote

   /dtml-in
   
   Is it possible to do the same with all dtml methods? I have tried
   replacing template with document_src but this gives a mixture of
   part rendered methods and error messages which is completely jumbled.
  Have you tried dtml-var document_src() instead of dtml-var 
  document_src?
It seems the pre tag was not doing enough to stop the browser from
rendering all the code. Replacing with xmp has worked!
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 )
   
  
 
 ___
 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 )


Re: [Zope] dtml Z SQL doubt

2007-03-22 Thread Maciej Wisniowski

 Hi all,

 I need to insert a row to mysql table if the corresponding  data not
 exist, if it exist i need to update the row.

 Can we do it using a single Z SQL method.
Yes, if your ZSQL will call stored procedure that will handle this logic.
Otherwise, I think you can't (but I might be wrong).

-- 
Maciej Wisniowski
___
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 )


Re: [Zope] dtml Z SQL doubt

2007-03-22 Thread Tino Wildenhain

Remil Mathew schrieb:

Hi all,

I need to insert a row to mysql table if the corresponding  data not 
exist, if it exist i need to update the row.


Can we do it using a single Z SQL method.


Well thats not business of ZSQL methods but rather
stuff you do with the instruments of your database.
Say SQL (or whatever SQL like mysql has there)

IIRC, mysql has some kind of UPSERT which should
handle it. If not, stored procedure or trigger
etc could do it.

Regards
Tino
___
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 )


Re: [Zope] dtml Z SQL doubt

2007-03-22 Thread Allen Schmidt Sr.

Just use REPLACE instead of INSERT.
If REPLACE statement is able to determine a unique value for a row and 
sees that that unique value exists for a row, the valued will be 
updated. If it does not exist, a new row will be inserted. This is what 
I use with MySQL.


Allen


Tino Wildenhain wrote:

Remil Mathew schrieb:


Hi all,

I need to insert a row to mysql table if the corresponding  data not 
exist, if it exist i need to update the row.


Can we do it using a single Z SQL method.



Well thats not business of ZSQL methods but rather
stuff you do with the instruments of your database.
Say SQL (or whatever SQL like mysql has there)

IIRC, mysql has some kind of UPSERT which should
handle it. If not, stored procedure or trigger
etc could do it.

Regards
Tino
___
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 )


Re: [Zope] dtml Z SQL doubt

2007-03-22 Thread Paul Winkler
On Thu, Mar 22, 2007 at 08:11:21AM -0400, Allen Schmidt Sr. wrote:
 Just use REPLACE instead of INSERT.
 If REPLACE statement is able to determine a unique value for a row and 
 sees that that unique value exists for a row, the valued will be 
 updated. If it does not exist, a new row will be inserted. This is what 
 I use with MySQL.

Or, depending on what you want, the INSERT...ON DUPLICATE KEY UPDATE
syntax can be used.
http://dev.mysql.com/doc/refman/5.0/en/insert-on-duplicate.html

Note that both of these idioms are specific to MySQL and not portable
to other databases.

-PW


-- 

Paul Winkler
http://www.slinkp.com
___
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 )


Re: [Zope] DTML Call Fails

2006-10-24 Thread Tino Wildenhain

[EMAIL PROTECTED] schrieb:

A little bit of legacy DTML fun here... Zope 2.9.3

On save of a DTML Method, why would this dtml-call fail:

dtml-let standards=REQUEST.SESSION
  dtml-call standards.set('AR-DA-08', AR-DA-08)
/dtml-let

With the error: 


Expression (Python) Syntax error: invalid token

Whereas this works fine:

dtml-let standards=REQUEST.SESSION
  dtml-call standards.set('AR-DA-07', AR-DA-07)
/dtml-let


I doubt any of that really works. So you happen
to have the variables named AR and DA defined
as numerical values somewhere? Otherwise the expression
makes no sense at all. The leading 0 in 08 and 07 indicates
you might have a completely other illusion on what's going on.

Any reason you cannot write in a python script something like:

REQUEST.SESSION.set('some_resonable_named_variable','AR-DA-07') ?

Could you explain in plain english what your final goal
of your construction is?

Regards
Tino Wildenhain
___
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 )


Re: [Zope] DTML Call Fails

2006-10-24 Thread Alexis Roda

En/na [EMAIL PROTECTED] ha escrit:

A little bit of legacy DTML fun here... Zope 2.9.3

On save of a DTML Method, why would this dtml-call fail:

dtml-let standards=REQUEST.SESSION
  dtml-call standards.set('AR-DA-08', AR-DA-08)
/dtml-let


AR - DA - 08
   ^ octal literal


HTH


___
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 )


Re: [Zope] DTML Call Fails

2006-10-24 Thread Andrew Milton
+---[ Tino Wildenhain ]--
| [EMAIL PROTECTED] schrieb:
| A little bit of legacy DTML fun here... Zope 2.9.3
| 
| On save of a DTML Method, why would this dtml-call fail:
| 
| dtml-let standards=REQUEST.SESSION
|   dtml-call standards.set('AR-DA-08', AR-DA-08)
| /dtml-let
| 
| With the error: 
| 
| Expression (Python) Syntax error: invalid token
| 
| Whereas this works fine:
| 
| dtml-let standards=REQUEST.SESSION
|   dtml-call standards.set('AR-DA-07', AR-DA-07)
| /dtml-let
| 
| I doubt any of that really works. So you happen
| to have the variables named AR and DA defined
| as numerical values somewhere? Otherwise the expression
| makes no sense at all. The leading 0 in 08 and 07 indicates
| you might have a completely other illusion on what's going on.

Apart from all of that;

A leading 0 indicates an octal number. 08 is not a valid octal number, but,
I'll just agree with Tino here, I don't think you know what you're trying to
do. I don't think you want.. AR minus DA minus 8 as the value.

-- 
Andrew Milton
[EMAIL PROTECTED]
___
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 )


Re: [Zope] DTML Call Fails

2006-10-24 Thread hpinson
Hi Tino.  Yes, that is correct. This application has variables named 
like:

'AR-DA-08'

This also fails in a Page Template:

span tal:define=standards python: request.SESSION
   tal:block define=temp python: data.set('AR-DA-08',AR-DA-
08)/tal:block
/span

With the error:

Compilation failed
TAL.TALDefs.TALError: Python expression error:
invalid token (Python expression data.set('AR-DA-08',AR-DA-08), 
line 1) in expression python: data.set('AR

Yet this works:

span tal:define=standards python: request.SESSION
   tal:block define=temp python: data.set('AR-DA-07',AR-DA-
07)/tal:block
/span

So you are saying the interpreter is seeing the '-' as a minus? Why 
would it work in one case and not the other?

Could the minus be escaped somehow?




-- 
Harlow Pinson
Indepth Learning
Email: [EMAIL PROTECTED]
Phone: 505 994-2135
Fax: 505 994-3603

___
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 )


Re: [Zope] DTML Call Fails

2006-10-24 Thread Jonathan


- Original Message - 
From: [EMAIL PROTECTED]

To: zope@zope.org
Sent: Tuesday, October 24, 2006 1:04 PM
Subject: Re: [Zope] DTML Call Fails



Hi Tino.  Yes, that is correct. This application has variables named
like:

'AR-DA-08'

This also fails in a Page Template:

span tal:define=standards python: request.SESSION
  tal:block define=temp python: data.set('AR-DA-08',AR-DA-
08)/tal:block
/span

With the error:

Compilation failed
TAL.TALDefs.TALError: Python expression error:
invalid token (Python expression data.set('AR-DA-08',AR-DA-08),
line 1) in expression python: data.set('AR

Yet this works:

span tal:define=standards python: request.SESSION
  tal:block define=temp python: data.set('AR-DA-07',AR-DA-
07)/tal:block
/span

So you are saying the interpreter is seeing the '-' as a minus? Why
would it work in one case and not the other?



Two possibilities that I can think of:

1) you have a variable called AR-DA-08 and do not have a variable called 
AR-DA-07


2) you have a variable called AR (and possibly another variable called DA), 
which when evaluated as a mathematical expression (AR minus DA - 08) 
provides a result, but when 07 is subtracted, an invalid result is obtained.


But, as others have noted, this does not appear to be what you are looking 
to accomplish!



Jonathan


___
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 )


Re: [Zope] DTML Call Fails

2006-10-24 Thread David H

[EMAIL PROTECTED] wrote:


A little bit of legacy DTML fun here... Zope 2.9.3

On save of a DTML Method, why would this dtml-call fail:

dtml-let standards=REQUEST.SESSION
 dtml-call standards.set('AR-DA-08', AR-DA-08)
/dtml-let

With the error: 


Expression (Python) Syntax error: invalid token

Whereas this works fine:

dtml-let standards=REQUEST.SESSION
 dtml-call standards.set('AR-DA-07', AR-DA-07)
/dtml-let

Any insight is appreciated.



 


hpinson,

Maybe you can get away with something like _['AR-DA-07']  or maybe 
_.getitem('AR_DA-07')?


David
___
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 )


Re: [Zope] DTML Call Fails

2006-10-24 Thread hpinson
Yep, changing to a underscore from a dash does the trick.

Thanks to everyone who helped me understand this.


-- 
Harlow Pinson
Indepth Learning
Email: [EMAIL PROTECTED]
Phone: 505 994-2135
Fax: 505 994-3603

___
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 )


Re: [Zope] DTML Call Fails

2006-10-24 Thread hpinson
Changing the dash to an underscore in the variable name solved the 
problem.


-- 
Harlow Pinson
Indepth Learning
Email: [EMAIL PROTECTED]
Phone: 505 994-2135
Fax: 505 994-3603

___
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 )


Re: [Zope] DTML Call Fails

2006-10-24 Thread Tino Wildenhain

[EMAIL PROTECTED] schrieb:
Hi Tino.  Yes, that is correct. This application has variables named 
like:


'AR-DA-08'


Not very clever.


This also fails in a Page Template:

span tal:define=standards python: request.SESSION
   tal:block define=temp python: data.set('AR-DA-08',AR-DA-
08)/tal:block


you still have to quote if you mean the variable with that
weird name. Otherwise its an expression in python.

_['AR-DA-08'] could work in DTML... but lets better forget
that ;) Where does your variable live? In Request maybe?


/span

With the error:

Compilation failed
TAL.TALDefs.TALError: Python expression error:
invalid token (Python expression data.set('AR-DA-08',AR-DA-08), 
line 1) in expression python: data.set('AR


TAL??



Yet this works:

span tal:define=standards python: request.SESSION
   tal:block define=temp python: data.set('AR-DA-07',AR-DA-
07)/tal:block
/span

So you are saying the interpreter is seeing the '-' as a minus? Why 
would it work in one case and not the other?


See Andrew's note on ocal numbers.



Could the minus be escaped somehow?


No, but see above.

Could you please escape the horribly code + template
mixing with DTML? ;) See the zope book for python scripts.
(After all in DTML expressions its already python code,
so why not write just python code and skip all that
foo stuff around it you dont need anyway?

Regards
Tino Wildenhain
___
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 )


Re: [Zope] DTML Call Fails

2006-10-24 Thread Tino Wildenhain

[EMAIL PROTECTED] schrieb:
Changing the dash to an underscore in the variable name solved the 
problem.


I'm quite sure you could solve it even better - if we would know
where these variables come from and what their meaning is.

I suspect some kind of form?

Regards
Tino Wildenhain
___
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 )


Re: [Zope] dtml-in sorting bug (collector #1884)

2006-09-01 Thread Andreas Jung



--On 1. September 2006 07:46:33 -0400 Allen Schmidt Sr. 
[EMAIL PROTECTED] wrote:



r.__cmp__(x,y) requires y to be a 'r', not a 'ImplicitAcquirerWrapper'

http://www.zope.org/Collectors/Zope/1884
I see this is a pending case but does anyone have any idea if it will be
fixed in future releases?

Finally got a 2.8.8 instance running with our Data (from 2.7.5) and was
able to run the catalog index fixer with help from Chris Withers
(THANKS!!) and all was looking good. The pages that looked up news
stories from the catalog are looking good. Then I went to a page that
displayed Houses (from ZSQL methods) and does a sort on the results as is
the case in MANY pages we have. The top line is the result on the error
page. Seems its a well know bug but does not look like its an issue to
most but it is to us.




Bugs are fixed on a voluntary basis. The chance having it fixed for the next
version is higher when you work  on a patch and tests. I doubt that this 
issue has a high priority for most of the core developers.


-aj 

pgp3g0Mpp2CEg.pgp
Description: PGP signature
___
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 )


Re: [Zope] DTML - ZPT

2006-08-31 Thread Andreas Jung



--On 31. August 2006 20:36:32 +0200 Antonio Beamud Montero 
[EMAIL PROTECTED] wrote:



Is this the equivalence?

dtml-var day fmt=%02i

td tal:replace=python:'%02i'%item['day']

or exists other way?



No.

-aj



pgpXRn0rh7dcJ.pgp
Description: PGP signature
___
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 )


Re: [Zope] DTML - ZPT

2006-08-31 Thread Tino Wildenhain
Antonio Beamud Montero wrote:
 Is this the equivalence?
 
 dtml-var day fmt=%02i
 
 td tal:replace=python:'%02i'%item['day']
 
 or exists other way?
 

Yes, you format your output in a (possibly
locales dependant) intermediate layer between
your application and your template.

In the easiest implementation it is a
python script which queries the original
item list and outputs a formattet item list
you use directly w/ path expressions only.

This way you can centrally control and
switch your formatting w/o touching the
templates anymore.

Regards
Tino Wildenhain
___
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 )


Re: [Zope] dtml forwarding request

2006-06-08 Thread Jonathan



if you want to go straight from one dtml routine to 
another just use dtml-var (ie. have dtml 
method A call dtml method B) - then in dtml method A have:

dtml-var methodB

This will 'pass' control and the REQUEST space from 
A to B.

Is this is not what you are looking for, then 
provide some more info as to your use case.



Jonathan

  - Original Message - 
  From: 
  Alric 
  Aneron 
  To: zope@zope.org 
  Sent: Thursday, June 08, 2006 4:22 
  PM
  Subject: [Zope] dtml forwarding 
  request
  Hello,Is there a way in Zope to forward a request from one 
  page to another. When I say "forward" a request, I want to retain all 
  the GET and POST request parameters. So similar to dtml-call 
  expr="RESPONSE.redirect('...')" but response.redirect loses all the 
  request parameters.I've been looking around and couldn't find it.Any 
  ideas?Thanks in advance!
  
  
  Yahoo! Groups gets better. Check 
  out the new email design. Plus there’s much more to come. 
  
  

  ___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-announcehttp://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 )


Re: [Zope] dtml forwarding request

2006-06-08 Thread Alric Aneron
The dtml_method where I want to forward to is on another server, so your may would be a little hard to do. Sorry, I didn't make myself clear the first time.Thanks, any suggestions?Jonathan [EMAIL PROTECTED] wrote:   if you want to go straight from one dtml routine to  another just use dtml-var (ie. have dtml  method A call dtml method B) - then in dtml method A have:  dtml-var methodB  This will
 'pass' control and the REQUEST space from  A to B.  Is this is not what you are looking for, then  provide some more info as to your use case.Jonathan- Original Message -From:AlricAneronTo: zope@zope.orgSent: Thursday, June 08, 2006 4:22PM   Subject: [Zope] dtml forwardingrequest   Hello,Is there a way in Zope to forward a request from onepage to another. When I say "forward" a request, I want to retain allthe GET and POST request parameters. So similar to dtml-callexpr="RESPONSE.redirect('...')" but response.redirect loses all therequest parameters.I've been looking around and couldn't find it.Anyideas?Thanks in advance! Yahoo! Groups gets better. Checkout the new email design. Plus there�s much more to come.   ___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-announcehttp://mail.zope.org/mailman/listinfo/zope-dev)
	
		Sneak preview the  all-new Yahoo.com. It's not radically different. Just radically better. 
___
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 )


Re: [Zope] dtml forwarding request

2006-06-08 Thread Dennis Allison

You can do a redirect and construct the cgi space from REQUEST.  


On Thu, 8 Jun 2006, Alric Aneron wrote:

 The dtml_method where I want to forward to is on another server, so your may 
 would be a little hard to do.  Sorry, I didn't make myself clear the first 
 time.
 
 Thanks, any suggestions?
 
 Jonathan [EMAIL PROTECTED] wrote:   if you want to go straight from one 
 dtml routine to  another just use dtml-var (ie.  have dtml  method A call 
 dtml method B) -  then in dtml method A have:
   
  dtml-var methodB
   
  This will 'pass' control and the REQUEST space from  A to B.
   
  Is this is not what you are looking for, then  provide some more info as to 
 your use case.
   
   
   
  Jonathan
 - Original Message - 
From:AlricAneron 
To: zope@zope.org 
Sent: Thursday, June 08, 2006 4:22PM
Subject: [Zope] dtml forwardingrequest

 
 Hello,
 Is there a way in Zope to forward a request from onepage to another.  
 When I say forward a request, I want to retain allthe GET and POST 
 request parameters.  So similar to dtml-call
 expr=RESPONSE.redirect('...') but response.redirect loses all the
 request parameters.
 I've been looking around and couldn't find it.
 Anyideas?
 
 Thanks in advance!
   
 
 -
Yahoo! Groups gets better. Checkout the new email design. Plus 
 there�s much more to come.   
 
 -
 
 ___
 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)
 
 
   
 -
 Sneak preview the  all-new Yahoo.com. It's not radically different. Just 
 radically better. 

-- 

___
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 )


Re: [Zope] dtml forwarding request

2006-06-08 Thread Jonathan



If you are using a zeo serverand both server 
are zeo clients you could store the info on the zeo server, then do a redirect 
from serverA/methodA to serverB/methodB.

If the servers do not have access to the same zeo 
server, then you are going to have to 'package-up' all the variables you need 
and send them to serverB/methodB

Depending on what is happening in serverB/methodB 
you could just do some kind of rpc from serverA/methodA to serverB/methodB (ie. 
methodA just sends a request to methodB, which does some processing and sends 
the results back to methodA for final processing/display).

It's kind of hard to guess what would be best 
without knowing more about the application(s).



Jonathan


  - Original Message - 
  From: 
  Alric 
  Aneron 
  To: Jonathan ; zope@zope.org 
  Sent: Thursday, June 08, 2006 4:31 
  PM
  Subject: Re: [Zope] dtml forwarding 
  request
  The dtml_method where I want to forward to is on another 
  server, so your may would be a little hard to do. Sorry, I didn't make 
  myself clear the first time.Thanks, any 
  suggestions?Jonathan [EMAIL PROTECTED] wrote:
  



if you want to go straight from one dtml 
routine to another just use dtml-var (ie. have dtml method A call dtml method B) - then in dtml 
method A have:

dtml-var methodB

This will 'pass' control and the REQUEST space 
from A to B.

Is this is not what you are looking for, then 
provide some more info as to your use case.



Jonathan

  - 
  Original Message - 
  From: 
  Alric 
  Aneron 
  To: 
  zope@zope.org 

  Sent: 
  Thursday, June 08, 2006 4:22 PM
  Subject: 
  [Zope] dtml forwarding request
  Hello,Is there a way in Zope to forward a request from 
  one page to another. When I say "forward" a request, I want to 
  retain all the GET and POST request parameters. So similar to 
  dtml-call expr="RESPONSE.redirect('...')" but response.redirect 
  loses all the request parameters.I've been looking around and couldn't 
  find it.Any ideas?Thanks in advance!
  
  
  Yahoo! Groups gets better. Check 
  out the new email design. Plus there�s much more to come. 
  
  

  ___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-announcehttp://mail.zope.org/mailman/listinfo/zope-dev 
  )
  
  
  Sneak preview the all-new 
  Yahoo.com. It's not radically different. Just radically better. 

___
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 )


Re: [Zope] dtml forwarding request

2006-06-08 Thread Alric Aneron
So there is no way to do it through python and DTML?I know Java has something like that.Jonathan [EMAIL PROTECTED] wrote: If you are using a zeo serverand both server  are zeo clients you could store the info on the zeo server, then do a redirect  from serverA/methodA to serverB/methodB.  If the servers do not have access to the same zeo  server, then you are going to have to 'package-up' all the variables you need  and send them to serverB/methodB  Depending on what
 is happening in serverB/methodB  you could just do some kind of rpc from serverA/methodA to serverB/methodB (ie.  methodA just sends a request to methodB, which does some processing and sends  the results back to methodA for final processing/display).  It's kind of hard to guess what would be best  without knowing more about the application(s).Jonathan - Original Message -From:AlricAneronTo: Jonathan ; zope@zope.orgSent: Thursday, June 08, 2006 4:31PM   Subject: Re: [Zope] dtml forwardingrequest   The dtml_method where I want to forward to is on anotherserver, so your may would be a little hard to do. Sorry, I didn't makemyself clear the first time.Thanks, anysuggestions?Jonathan [EMAIL PROTECTED] wrote:   if you want to go straight from
 one dtml  routine to another just use dtml-var (ie. have dtml method A call dtml method B) - then in dtml  method A have:  dtml-var methodB  This will 'pass' control and the REQUEST space  from A to B.  Is this is not what you are looking for, then  provide some more info as to your use case.Jonathan-Original Message -From:AlricAneronTo:zope@zope.org Sent:Thursday, June 08, 2006 4:22 PM   Subject:[Zope] dtml forwarding request   Hello,Is there a way in Zope to forward a request fromone page to another. When I say "forward" a request, I want toretain all the GET and POST request parameters. So similar todtml-call expr="RESPONSE.redirect('...')" but response.redirectloses all the request parameters.I've been looking around and couldn't
find it.Any ideas?Thanks in advance! Yahoo! Groups gets better. Checkout the new email design. Plus there�s much more to come.   ___Zopemaillist -Zope@zope.orghttp://mail.zope.org/mailman/listinfo/zope**No cross posts or HTML encoding! **(Related lists -http://mail.zope.org/mailman/listinfo/zope-announcehttp://mail.zope.org/mailman/listinfo/zope-dev) Sneak preview the all-newYahoo.com. It's not radically different. Just radically better. 
 
	
		Sneak preview the  all-new Yahoo.com. It's not radically different. Just radically better. 
___
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 )


Re: [Zope] dtml forwarding request

2006-06-08 Thread Tino Wildenhain
Alric Aneron wrote:
 So there is no way to do it through python and DTML?
 
 I know Java has something like that.

*lol*

Well you should be sure you know what you do anyways.
Forwarding requests means you trust the users browser
to do the right thing. Maybe you can instead make
a subrequest by means of urllib and friends.

Construct url (e.g. GET-parameters) is easy:

in a python script:

from ZTUtils import make_query

targeturl=http://other.server/script?+make_query(**context.REQUEST.form)

(untested) should work.

To construct form elements there is a similar function in ZTUtils, but
I dont remember the name w/o looking at the source.

Regards
Tino Wildenhain
___
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 )


Re: [Zope] dtml forwarding request

2006-06-08 Thread Paul Winkler
On Thu, Jun 08, 2006 at 11:39:19PM +0200, Tino Wildenhain wrote:
 Alric Aneron wrote:
  So there is no way to do it through python and DTML?
  
  I know Java has something like that.
 

ZEO is the canonical way to distribute zope stuff.
 
 Well you should be sure you know what you do anyways.
 Forwarding requests means you trust the users browser
 to do the right thing. Maybe you can instead make
 a subrequest by means of urllib and friends.

If you do that, you're getting into the world of RPC and
service-oriented development.  There are a zillion ways to do that in
zope...  urllib/urllib2 as suggested, or you can use the callRemote()
features of a sufficiently recent ZSyncer (see the README), or use
zope's built-in XMLRPC server and on the client side use python's
xmlrpclib.  The latter two options are nice because they give you native
python objects on both ends of the wire.

Pretty much all of these will require you to write some trusted code,
i.e. on the filesystem (in a Product or External Method).

-- 

Paul Winkler
http://www.slinkp.com
___
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 )


Re: [Zope] DTML-In with date/time filter

2006-05-04 Thread Chris Withers

Dieter Maurer wrote:

Martin Koekenberg wrote at 2006-5-3 14:47 +0200:
I use this code in a Python script and call this script within a DTML-IN 
statement. What I need is a script to get only items with a date in the 
future, today or in the past.  The objects are DTML Documents with a date 
property field. 


Assuming, your property contains a date, you can uses something like
(to get things with dates in the future):

   now = container.ZopeTime() # see the DateTime documentation for other times
   return [obj for obj in context.objectValues()
   if obj.getProperty(...)  now


I'm fairly sure he'll want to change that if statement to:

if not obj.getProperty(...).latestTime().isPast()

cheers,

Chris

--
Simplistix - Content Management, Zope  Python Consulting
   - http://www.simplistix.co.uk

___
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 )


Re: [Zope] DTML-In with date/time filter

2006-05-03 Thread Andreas Jung



--On 3. Mai 2006 12:17:36 +0200 Martin Koekenberg 
[EMAIL PROTECTED] wrote:




 Hallo,
I can create a dtml-in filte with the following code:

return [doc for doc in context.objectValues('DTML Document')  if
doc.getProperty('a')!='de']


Using return in DTML does not make sense. Writing such code in DTML
is bad-style. Use Pythonscript for this code and call the script from
DTML (btw. better user ZPT).




How can I do the same with a date or time ?


What does that mean?

-aj


--
ZOPYX Ltd.  Co. KG - Charlottenstr. 37/1 - 72070 Tübingen - Germany
Web: www.zopyx.com - Email: [EMAIL PROTECTED] - Phone +49 - 7071 - 793376
E-Publishing, Python, Zope  Plone development, Consulting


pgpZMOmKPCgL4.pgp
Description: PGP signature
___
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 )


Re: [Zope] DTML-In with date/time filter

2006-05-03 Thread Martin Koekenberg

 
 
HelloAndreas, I use this code in a Python script and call 
this script within a DTML-IN statement. What I need is a script to get only 
items with a date in the future, today or in the past. The objects are 
DTML Documents with a date property field.   
Regards  Martin Koekenberg 
  -Original Message-From: Andreas Jung 
[EMAIL PROTECTED]To: Martin Koekenberg 
[EMAIL PROTECTED], zope@zope.orgDate: Wed, 03 May 
2006 12:20:33 +0200Subject: Re: [Zope] DTML-In with date/time filter
 --On 
3. Mai 2006 12:17:36 +0200 Martin Koekenberg 
[EMAIL PROTECTED] wrote: 
Hallo, I can create a dtml-in filte with the following 
code: return [doc for doc in context.objectValues('DTML 
Document') if doc.getProperty('a')!='de']Using 
"return" in DTML does not make sense. Writing such code in DTMLis 
bad-style. Use Pythonscript for this code and call the script fromDTML 
(btw. better user ZPT). How can I do the same with a 
date or time ?What does that mean?-aj-- 
ZOPYX Ltd.  Co. KG - Charlottenstr. 37/1 - 72070 Tübingen - Germany
Web: www.zopyx.com - Email: 
[EMAIL PROTECTED] - Phone +49 - 7071 - 793376E-Publishing, Python, Zope 
 Plone development, Consulting

___
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 )


Re: [Zope] DTML-In with date/time filter

2006-05-03 Thread Jonathan
You are going to have to loop thru the documents and use 'getProperty' to 
access the date property field on the document. Then you will need to 
compare the date value (the Zope Book V2.6 has a good description of 
dates/time usage) to see if it is in the range you need.  You could use a 
python script to do this loop/compare and return a list of document ids 
which you could then display via your DTML-in stmt.


If you have a lot of documents this could be a very expensive approach.  You 
might want to have a look at ZCatalog.


hth

Jonathan


- Original Message - 
From: Martin Koekenberg

To: zope@zope.org
Sent: Wednesday, May 03, 2006 8:47 AM
Subject: Re: [Zope] DTML-In with date/time filter


Hello Andreas,
I use this code in a Python script and call this script within a DTML-IN 
statement. What I need is a script to get only items with a date in the 
future, today or in the past.  The objects are DTML Documents with a date 
property field.


Regards

Martin Koekenberg




-Original Message-
From: Andreas Jung [EMAIL PROTECTED]
To: Martin Koekenberg [EMAIL PROTECTED], zope@zope.org
Date: Wed, 03 May 2006 12:20:33 +0200
Subject: Re: [Zope] DTML-In with date/time filter




--On 3. Mai 2006 12:17:36 +0200 Martin Koekenberg
[EMAIL PROTECTED] wrote:



 Hallo,
I can create a dtml-in filte with the following code:

return [doc for doc in context.objectValues('DTML Document')  if
doc.getProperty('a')!='de']


Using return in DTML does not make sense. Writing such code in DTML
is bad-style. Use Pythonscript for this code and call the script from
DTML (btw. better user ZPT).




How can I do the same with a date or time ?


What does that mean?

-aj


--
ZOPYX Ltd.  Co. KG - Charlottenstr. 37/1 - 72070 Tübingen - Germany
Web: www.zopyx.com - Email: [EMAIL PROTECTED] - Phone +49 - 7071 - 793376
E-Publishing, Python, Zope  Plone development, Consulting




___
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 )


Re: [Zope] DTML-In with date/time filter

2006-05-03 Thread Dieter Maurer
Martin Koekenberg wrote at 2006-5-3 14:47 +0200:
I use this code in a Python script and call this script within a DTML-IN 
statement. What I need is a script to get only items with a date in the 
future, today or in the past.  The objects are DTML Documents with a date 
property field. 

Assuming, your property contains a date, you can uses something like
(to get things with dates in the future):

   now = container.ZopeTime() # see the DateTime documentation for other times
   return [obj for obj in context.objectValues()
   if obj.getProperty(...)  now
   ]

-- 
Dieter
___
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 )


Re: [Zope] dtml methods and namespace

2006-03-15 Thread Chris Withers

Luca Dall'Olio wrote:
I have a simple dtml-method assignment-action that is called upon a 
form post.


Why are you torturing yourself with DTML?

I'd urge you to try Python Scripts and Page Templates instead!

cheers,

Chris

--
Simplistix - Content Management, Zope  Python Consulting
   - http://www.simplistix.co.uk

___
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 )


Re: [Zope] dtml methods and namespace

2006-03-09 Thread David

Luca Dall'Olio wrote:


Hi to everybody,

I have a simple dtml-method assignment-action that is called upon a 
form post.
Depending on the form request data, a dtml-if chooses between one of 
two dtml-documents : assigment-success and assignment-failure :


dtml-if  iscorrect()
dtml-var assignment-success
dtml-else
dtml-var assignment-failure
/dtml-if

My trouble is that neither the assignment-success nor the 
assignment-failure dtml-documents seem to be pushed on the namespace 
: inside them title_or_id references data from their caller, this() 
and PARENTS do not evaluate right... is there a smarter way to call a 
dtml-document inside a dtml-method (), so that it it pushed on the 
namespace stack? Should I use somehow the dtml-with tag?


I understand that page templates would be way easier and cleaner, but 
I would like to complete this project and then try them out in the 
next one...


thank you in advance,
Luca


Luca,

Not sure exactly whats going on there ... but  there are significant 
differences between dtml methods and dtml documents and how they view 
identity. 


David

___
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 )


Re: [Zope] dtml methods and namespace

2006-03-09 Thread Dieter Maurer
Luca Dall'Olio wrote at 2006-3-9 11:47 +0100:
I have a simple dtml-method assignment-action that is called upon a 
form post.
Depending on the form request data, a dtml-if chooses between one of 
two dtml-documents : assigment-success and assignment-failure :

dtml-if  iscorrect()
 dtml-var assignment-success
dtml-else
 dtml-var assignment-failure
/dtml-if

My trouble is that neither the assignment-success nor the 
assignment-failure dtml-documents seem to be pushed on the namespace : 
inside them title_or_id references data from their caller

That is strange. In fact, a DTMLDocument (unlike a DTMLMethod!)
extends the passed in client by self.aq_explicit.
Note, that due to the use of aq_explicit, acquisition through
your DTMLDocument is restricted.

 this() and 
PARENTS do not evaluate right...

PARENTS is set after the traversal phase. Lateron, it is not changed --
e.g. not changed by calls of DMTL objects.

is there a smarter way to call a 
dtml-document inside a dtml-method (), so that it it pushed on the 
namespace stack?

It should be pushed automatically (as long as it is really a
DTMLDocument.

Of course, you can control the context yourself, e.g. by

   dtml-var doc(doc,_)

In this case, you pass doc (assumed to be your DTML document)
explicitly as client.

-- 
Dieter
___
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 )


Re: [Zope] DTML-In with filter

2006-03-08 Thread Tino Wildenhain

Martin Koekenberg schrieb:

Hello,
 
Is it possible to use a DTML-In to display all DTML Documents in a 
folder exept the one's with a centain value in a property ?
 
Example.
 
DTML Document one with property a=bc

DTML Document two with property a=de
DTML Document three with property a=bc
 
Now I want to use DTML-IN to display all the dtml documents except the 
ones with property a=de.
I also use the size and batchsize property to create links to the next 
10 documents. If I use an if statement the next 10 can be 9 ore 
less 9 items because there could be one ore more documents with a=de.


Just drop this DTML... or at least get help from python:

return [doc for doc in context.objectValues('DTML Document')  if 
doc.getProperty('a')!='de']


(python script or the like would be your friend - also
it makes it possible to replace the quite costy objectValues()
call with ZCatalog query w/o changing your presentation code)

Regards
Tino
___
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 )


Re: [Zope] DTML-In with filter

2006-03-08 Thread Andrew Milton
+---[ Martin Koekenberg ]--
| Hello,
|  
| Is it possible to use a DTML-In to display all DTML Documents in a folder 
exept
| the one's with a centain value in a property ?
|  
| Example.
|  
| DTML Document one with property a=bc
| DTML Document two with property a=de
| DTML Document three with property a=bc
|  
| Now I want to use DTML-IN to display all the dtml documents except the ones
| with property a=de.
| I also use the size and batchsize property to create links to the next 10
| documents. If I use an if statement the next 10 can be 9 ore less 9 items
| because there could be one ore more documents with a=de.
|  
| Who can help me ?

Pseudo-code (dtml-like)

dtml-in someListOfThings
dtml-with thecurrentitem
dtml-unless a=='de'
dtml-var thecurrentitem
/dtml-unless
/dtml-with
/dtml-in

Or you could write a python script that filtered out the ones you wanted and
call the python script to return the list of things to display, which is
probably a much better idea.

-- 
Andrew Milton
[EMAIL PROTECTED]
___
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 )


Re: [Zope] dtml result in href

2006-03-08 Thread Andrew Milton
+---[ Olivier Wambacq ]--
| another question.
| 
| when I create a link with a filename and url from a database.
| I do it like this:
| 
| a href=span tal:conent=result/urlurl goes here/span
| span tal:conent=result/filenamefilename goes here/span
| /a

This is DTML or a ZPT ?

for a ZPT its;

a tal:attributes=href result/url tal:content=result/filenamefile/a

for DTML it would be;

a href=dtml-var result.url etc

-- 
Andrew Milton
[EMAIL PROTECTED]
___
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 )


Re: [Zope] dtml-tree (urlparam)

2005-12-08 Thread Ulla Theiss

Dear list,

many thanks for the link to a little bit more documentation of 
dtml-tree. Unfortunately the parameter of interest (urlparam - Since 
Zope 2.2??) is not mentioned there.


Meanwhile I found in the Zope-Bible (Chapter 4, Page 115): The use of 
this attribute [urlparam] is somewhat limited because Zope simply passes 
along whatever string you specify as the value for the urlparam 
attribute. Expressions, and therefore the dynamic insertion of 
variables, are not possible with this attribute under the current 
version of Zope.  ;-(


The first question is clear now, but the second one becomes more and 
more important:


Does anybody have an idea to work around the problem?

Again, many, many thanks in advance,
Ulla.


Jonathan wrote:


Have you looked at this:

http://www.zope.org/Documentation/Guides/DTML-HTML/DTML.15.html


Jonathan

- Original Message - From: Ulla Theiss [EMAIL PROTECTED]
To: Zope Mailing List zope@zope.org
Sent: Wednesday, December 07, 2005 4:50 PM
Subject: [Zope] dtml-tree (urlparam)



Dear list,

I have a problem using dtml-tree.

The page which contains a dtml-tree should show a dynamic parameter, 
passed with to url calling the dtml-tree-page.


page_with_dtml_tree?myparam=yup

Before expanding or collapsing the tree, everything works fine.

But if I expand or collapse it, this parameter is forgotten.

I found the dtml-tree-parameter urlparam, which is included in the 
expanding and collapsing widget links.

dtml-tree urlparam=myparam=abc

This works fine with hard coded strings.

* But my string is dynamic! *
How can I pass it?

dtml-tree urlparam=myparam=dtml-var myparam produced  
syntax-errors.


Has somebody an idea, how to pass it - or how to work around the 
problem?


Many thanks in advance,
Ulla.


___
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 )


Re: [Zope] dtml-tree (urlparam)

2005-12-08 Thread Dieter Maurer
Ulla Theiss wrote at 2005-12-8 10:55 +0100:
many thanks for the link to a little bit more documentation of 
dtml-tree. Unfortunately the parameter of interest (urlparam - Since 
Zope 2.2??) is not mentioned there.

Meanwhile I found in the Zope-Bible (Chapter 4, Page 115): The use of 
this attribute [urlparam] is somewhat limited because Zope simply passes 
along whatever string you specify as the value for the urlparam 
attribute. Expressions, and therefore the dynamic insertion of 
variables, are not possible with this attribute under the current 
version of Zope.  ;-(

The first question is clear now, but the second one becomes more and 
more important:

Does anybody have an idea to work around the problem?

Someone implemented an urlparam_expr extension
and donated it to Zope by putting it into the old collector.
But the old collector broke and its content was lost...

Maybe, a mail archive search can still locate the extension for
you.

If not, it is not difficult to create the extension again (you
would follow the example of the other *_expr implementations).
Maybe, this time, such an extension could be successfully integrated into
Zope?

-- 
Dieter
___
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 )


Re: [Zope] dtml-tree (urlparam)

2005-12-07 Thread Jonathan

Have you looked at this:

http://www.zope.org/Documentation/Guides/DTML-HTML/DTML.15.html


Jonathan

- Original Message - 
From: Ulla Theiss [EMAIL PROTECTED]

To: Zope Mailing List zope@zope.org
Sent: Wednesday, December 07, 2005 4:50 PM
Subject: [Zope] dtml-tree (urlparam)



Dear list,

I have a problem using dtml-tree.

The page which contains a dtml-tree should show a dynamic parameter, 
passed with to url calling the dtml-tree-page.


page_with_dtml_tree?myparam=yup

Before expanding or collapsing the tree, everything works fine.

But if I expand or collapse it, this parameter is forgotten.

I found the dtml-tree-parameter urlparam, which is included in the 
expanding and collapsing widget links.

dtml-tree urlparam=myparam=abc

This works fine with hard coded strings.

* But my string is dynamic! *
How can I pass it?

dtml-tree urlparam=myparam=dtml-var myparam produced  syntax-errors.

Has somebody an idea, how to pass it - or how to work around the problem?

Many thanks in advance,
Ulla.


___
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 )


RE: [Zope] dtml-sqlvar problem with large strings?

2005-11-21 Thread Joshua Burvill

Hello All,

I tried using zope 2.7.6 with kinterbasdbda 2.0 and I got the same error I
think, but more informative :)  

ProgrammingError: (0, 'SQL statement of 2270651 bytes is too long (max 65535
allowed). Consider using parameters to shorten the SQL code, rather than
passing large values as part of the SQL string.')

So I guess it is the DA that disallows the long statement. So I will
Consider using parameters... as it says.

Otherwise I can look at switching to mxODBC. I wonder if that would disallow
such long statements as well?

Thanks for the help. 

Josh



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 Shared.DC.Scripts.Bindings, line 306, in __call__ 
Module Shared.DC.Scripts.Bindings, line 343, in _bindAndExec 
Module Products.PythonScripts.PythonScript, line 323, in _exec 
Module None, line 16, in upload_process
PythonScript at /external/dr3/test/quotes/upload_process
Line 16 
Module Shared.DC.ZRDB.DA, line 454, in __call__
SQL instance at 04168BC0 
Module Products.kInterbaseDA.db, line 226, in query 
Module Products.kInterbaseDA.db, line 255, in _executeSQLAndReturnResultRows

Module kinterbasdb, line 1592, in execute 
ProgrammingError: (0, 'SQL statement of 2270651 bytes is too long (max 65535
allowed). Consider using parameters to shorten the SQL code, rather than
passing large values as part of the SQL string.')






-Original Message-
From: Andreas Jung [mailto:[EMAIL PROTECTED] 
Sent: Monday, 21 November 2005 4:36 PM
To: Joshua Burvill; zope@zope.org
Subject: Re: [Zope] dtml-sqlvar problem with large strings?



--On 21. November 2005 16:30:10 +1100 Joshua Burvill [EMAIL PROTECTED] 
wrote:

 Using zope 2.6.4 on win32 with kinterbasdbda (not sure what version),
 firebird 1.0


This sounds like a bug in the kinterbasedbda. Since this is DA is not used 
widely I would recommend to buzz the author of the DA directly. When you 
are on Windows you could consider switching to mxODBC in case your database 
supports ODBC.

-aj



___
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 )


RE: [Zope] dtml-sqlvar problem with large strings?

2005-11-21 Thread Andreas Jung



--On 22. November 2005 08:42:32 +1100 Joshua Burvill [EMAIL PROTECTED] 
wrote:

statement. So I will

Consider using parameters... as it says.

Otherwise I can look at switching to mxODBC. I wonder if that would
disallow such long statements as well?


You could try it and report back :-)

-aj




pgpUd3NMRyRK0.pgp
Description: PGP signature
___
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 )


Re: [Zope] dtml-sqlvar problem with large strings?

2005-11-20 Thread Andreas Jung



--On 21. November 2005 16:30:10 +1100 Joshua Burvill [EMAIL PROTECTED] 
wrote:


Using zope 2.6.4 on win32 with kinterbasdbda (not sure what version),
firebird 1.0


This sounds like a bug in the kinterbasedbda. Since this is DA is not used 
widely I would recommend to buzz the author of the DA directly. When you 
are on Windows you could consider switching to mxODBC in case your database 
supports ODBC.


-aj




pgpJvaUW6bW2A.pgp
Description: PGP signature
___
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 )


Re: [Zope] DTML-tree Custom sort

2005-10-02 Thread Andreas Jung



--On 2. Oktober 2005 09:43:02 -0700 Alex Renier [EMAIL PROTECTED] 
wrote:



dtml-tree branches_expr=objectValues(['Folder'])
sort=orderInt skip_unauthorized



perhaps

dtml-tree branches_expr=[o for o in objectValues(['Folder'] if 
hasattr('orderInt')])

sort=orderInt skip_unauthorized

-aj




pgpWmIyIyPjF8.pgp
Description: PGP signature
___
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 )


Re: [Zope] DTML-tree Custom sort

2005-10-02 Thread Alex Renier
Thanks for your help AJ
I get this:

Error Type: SyntaxError
Error Value: invalid syntax (line 1)

dtml-tree branches_expr=[o for o in
objectValues(['Folder'] if hasattr('orderInt'))]
sort=orderInt skip_unauthorized

It doesn't like how I put spaces in objectValues()
attributes for  if hasattr...
Is the syntax a bit different?
Thanks!

--- Andreas Jung [EMAIL PROTECTED] wrote:

 
 
 --On 2. Oktober 2005 09:43:02 -0700 Alex Renier
 [EMAIL PROTECTED] 
 wrote:
 
  dtml-tree
 branches_expr=objectValues(['Folder'])
  sort=orderInt skip_unauthorized
 
 
 perhaps
 
 dtml-tree branches_expr=[o for o in
 objectValues(['Folder'] if 
 hasattr('orderInt')])
 sort=orderInt skip_unauthorized
 
 -aj
 
 
 




__ 
Yahoo! Mail - PC Magazine Editors' Choice 2005 
http://mail.yahoo.com
___
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 )


Re: [Zope] dtml-if

2005-08-29 Thread Tino Wildenhain
Am Montag, den 29.08.2005, 14:08 +1000 schrieb michael:
 Thanks thats it!  Why is it like that?
 
...
 
  On 8/28/05, michael [EMAIL PROTECTED] wrote:
 
  What am I doing wrong here?
 
  dtml-var last -- this prints out the variable sent from last
  (referring) page fine
  dtml-var id -- this prints out the id of the current item fine
 
 
  dtml-if id == last  this one!  /dtml-if
 
  i want this to output this one! when the current item is the one
  requested by the last page but they are never seen as == even when the
  two dtml-var are the same
 
  they are never equal!

You will see this in the list archives several times in the past.
Depending on the object, id is a method and not an simple attribute.

To be on the save side (instead of figuring out what it is actually)
always use: getId()

Btw. dtml-var id does not use the id the same way like 
dtml-if id==last. Try dtml-var id and you will see
the method signature (view document source in the browser)

I'd recommend doing that all in a python script and then
use the prepared data in your DTML - oder later ZPT.



___
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 )


Re: [Zope] dtml-if

2005-08-28 Thread Greg Fischer
I have never been able to do that either and always wondered how to do
it.  However I have a workaround that I use frequently.  I just use
the title instead, which works perfectly.

dtml-if title == 'My Page' This one!/dtml-if

Greg


On 8/28/05, michael [EMAIL PROTECTED] wrote:
 What am I doing wrong here?
 
 dtml-var last -- this prints out the variable sent from last
 (referring) page fine
 dtml-var id -- this prints out the id of the current item fine
 
 
 dtml-if id == last  this one!  /dtml-if
 
 i want this to output this one! when the current item is the one
 requested by the last page but they are never seen as == even when the
 two dtml-var are the same
 
 they are never equal!
 
 
 thanks,
 mike
 
 
 ___
 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 )
 


-- 
Greg Fischer
1st Byte Solutions
http://www.1stbyte.com
___
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 )


Re: [Zope] dtml-if

2005-08-28 Thread michael
Thanks for your reply, that is half way there, I want to compare two 
variables though. where as 'my page' is constant, and hard coded in.


someone's gotta know :-)

mike

Greg Fischer wrote:


I have never been able to do that either and always wondered how to do
it.  However I have a workaround that I use frequently.  I just use
the title instead, which works perfectly.

dtml-if title == 'My Page' This one!/dtml-if

Greg


On 8/28/05, michael [EMAIL PROTECTED] wrote:
 


What am I doing wrong here?

dtml-var last -- this prints out the variable sent from last
(referring) page fine
dtml-var id -- this prints out the id of the current item fine


dtml-if id == last  this one!  /dtml-if

i want this to output this one! when the current item is the one
requested by the last page but they are never seen as == even when the
two dtml-var are the same

they are never equal!


thanks,
mike


___
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 )


Re: [Zope] dtml-if

2005-08-28 Thread David Siedband

Try calling id then comparing it.

dtml-if id()==last this one! /dtml-if

--
David



On Aug 28, 2005, at 7:19 PM, michael wrote:

Thanks for your reply, that is half way there, I want to compare two 
variables though. where as 'my page' is constant, and hard coded in.


someone's gotta know :-)

mike

Greg Fischer wrote:


I have never been able to do that either and always wondered how to do
it.  However I have a workaround that I use frequently.  I just use
the title instead, which works perfectly.

dtml-if title == 'My Page' This one!/dtml-if

Greg


On 8/28/05, michael [EMAIL PROTECTED] wrote:


What am I doing wrong here?

dtml-var last -- this prints out the variable sent from last
(referring) page fine
dtml-var id -- this prints out the id of the current item fine


dtml-if id == last  this one!  /dtml-if

i want this to output this one! when the current item is the one
requested by the last page but they are never seen as == even when 
the

two dtml-var are the same

they are never equal!


thanks,
mike


___
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 )


Re: [Zope] dtml-if

2005-08-28 Thread michael

Thanks thats it!  Why is it like that?

m


David Siedband wrote:


Try calling id then comparing it.

dtml-if id()==last this one! /dtml-if

--
David



On Aug 28, 2005, at 7:19 PM, michael wrote:

Thanks for your reply, that is half way there, I want to compare two 
variables though. where as 'my page' is constant, and hard coded in.


someone's gotta know :-)

mike

Greg Fischer wrote:


I have never been able to do that either and always wondered how to do
it.  However I have a workaround that I use frequently.  I just use
the title instead, which works perfectly.

dtml-if title == 'My Page' This one!/dtml-if

Greg


On 8/28/05, michael [EMAIL PROTECTED] wrote:


What am I doing wrong here?

dtml-var last -- this prints out the variable sent from last
(referring) page fine
dtml-var id -- this prints out the id of the current item fine


dtml-if id == last  this one!  /dtml-if

i want this to output this one! when the current item is the one
requested by the last page but they are never seen as == even when the
two dtml-var are the same

they are never equal!


thanks,
mike




___
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 )


Re: [Zope] dtml-var variable from REQUEST not shown in input tag if it has spaces??

2005-08-04 Thread Tino Wildenhain
Am Donnerstag, den 04.08.2005, 11:33 +0100 schrieb Thomas Apostolou:
 Hello everybody,
 
 Im using Zope 2.7.0 on Windows XP Pro.
 I pass some parameters from a form to a DTML method.
 Inside that method i try to get the parameters with
 dtml-var sSQL ( sSQL is the name of the submiting
 form's field).
 When i just use it as dtml-var sSQL everything is
 ok.
 When i use it like : input type=text
 value=dtml-var sSQL, i get everything until the
 first space. For example from select * from mytable
 i get select.
 
 Is it something wrong with what i am doing?

Yes, you should write HTML when you want HTML ;)
This means, attribute values in HTML are supposed
to be in  
(See the HTML source in your Browser when you display
the page and you will know what I mean :)

So, if you really want DTML here, use:

input type=text value=dtml-var sSQL /

or 

input type=text value=dtml-sSQL; /

which is a bit nicer because you dont write a tag inside
a tag.

OR use ZPT:

input type=text tal:attributes=value request/sSQL /



___
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 )


Θέμα: Re: [Zope] dtml-var variable fro m REQUEST not shown in input tag if it has spaces??

2005-08-04 Thread Thomas Apostolou

--- Tino Wildenhain [EMAIL PROTECTED] έγραψε:

 
 Yes, you should write HTML when you want HTML ;)
 This means, attribute values in HTML are supposed
 to be in  
 (See the HTML source in your Browser when you
 display
 the page and you will know what I mean :)
 
 So, if you really want DTML here, use:
 
 input type=text value=dtml-var sSQL /
 
 or 
 
 input type=text value=dtml-sSQL; /
 
 which is a bit nicer because you dont write a tag
 inside
 a tag.
 
 OR use ZPT:
 
 input type=text tal:attributes=value
 request/sSQL /
 
 
 
 

was that a realy stupid question or what? 8-
Thanks anyway,
Thomas Apostolou






___ 
Χρησιμοποιείτε Yahoo!; 
Βαρεθήκατε τα ενοχλητικά μηνύματα (spam); Το Yahoo! Mail 
διαθέτει την καλύτερη δυνατή προστασία κατά των ενοχλητικών 
μηνυμάτων http://login.yahoo.com/config/mail?.intl=gr 

___
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 )


Re: [Zope] DTML parsing outside of Zope

2005-07-28 Thread Jonathan


- Original Message - 
From: Peter Bengtsson [EMAIL PROTECTED]

To: zope@zope.org
Sent: Thursday, July 28, 2005 5:59 AM
Subject: [Zope] DTML parsing outside of Zope



I would like to be able to parse a very basic DTML string (a
ZSQLMethod on the file system actually) outside Zope, ie. without
having the whole zserver running.
The DTML inside the string is very basic. It doesn't use REQUEST or
aqcuisition. It's using dtml-if 1==2 and stuff.
I've tried looking on the source code but it's so damn complicated for
me. Can anybody give me a headstart on this?



If you are trying to access the zodb without having zope running, here are a 
couple of ways to make it happen:


# method #1
import os, sys, traceback
sys.path.append(/apps/zope/lib/python)
import Zope
app=Zope.app()
from Testing import makerequest
app = makerequest.makerequest(app)


# method #2
import os, sys
sys.path.append(/apps/zope/lib/python)
import Zope
import time
app=Zope.app()


Once you have 'app' you can do things like:

REQUEST = app.REQUEST
newobj = 
app.Wet.Content.Data.manage_addProduct['myProd'].manage_addmyItem(...)

app.unrestrictedTraverse('Control_Panel/Database/ShopwiserData').manage_pack()

hth

Jonathan 



___
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 )


Re: [Zope] DTML parsing outside of Zope

2005-07-28 Thread Peter Bengtsson
 import Zope
 app=Zope.app()

No. I've actually found a way to do it without starting zope (thus,
not using the ZODB).
The trick was in import nvSQL from DA.py and use that. It works now, I
can now parse and run ZSQL methods on the filesystem without having
any zope running.
I'm going to tidy my script and post it on my blog soon.

On 7/28/05, Jonathan [EMAIL PROTECTED] wrote:
 
 - Original Message -
 From: Peter Bengtsson [EMAIL PROTECTED]
 To: zope@zope.org
 Sent: Thursday, July 28, 2005 5:59 AM
 Subject: [Zope] DTML parsing outside of Zope
 
 
 I would like to be able to parse a very basic DTML string (a
  ZSQLMethod on the file system actually) outside Zope, ie. without
  having the whole zserver running.
  The DTML inside the string is very basic. It doesn't use REQUEST or
  aqcuisition. It's using dtml-if 1==2 and stuff.
  I've tried looking on the source code but it's so damn complicated for
  me. Can anybody give me a headstart on this?
 
 
 If you are trying to access the zodb without having zope running, here are a
 couple of ways to make it happen:
 
 # method #1
 import os, sys, traceback
 sys.path.append(/apps/zope/lib/python)
 import Zope
 app=Zope.app()
 from Testing import makerequest
 app = makerequest.makerequest(app)
 
 
 # method #2
 import os, sys
 sys.path.append(/apps/zope/lib/python)
 import Zope
 import time
 app=Zope.app()
 
 
 Once you have 'app' you can do things like:
 
 REQUEST = app.REQUEST
 newobj =
 app.Wet.Content.Data.manage_addProduct['myProd'].manage_addmyItem(...)
 app.unrestrictedTraverse('Control_Panel/Database/ShopwiserData').manage_pack()
 
 hth
 
 Jonathan
 
 
 


-- 
Peter Bengtsson, 
work www.fry-it.com
home www.peterbe.com
hobby www.issuetrackerproduct.com
___
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 )


Re: [Zope] dtml to pdf

2005-07-15 Thread Chris Withers

Allen Huang wrote:

How do I change my webpage into pdf using dtml or python script?


Reportlab is your friend. Google might help you find it ;-)

Chris

--
Simplistix - Content Management, Zope  Python Consulting
   - http://www.simplistix.co.uk
___
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 )


Re: [Zope] dtml to pdf

2005-07-15 Thread Dennis Allison

For simple conversion, you may find htmldoc to be a good choice.
Reportlab is a great tool but takes considerable effort; htmldoc
gives a good enough solution in many cases.


On Fri, 15 Jul 2005, Chris Withers wrote:

 Allen Huang wrote:
  How do I change my webpage into pdf using dtml or python script?
 
 Reportlab is your friend. Google might help you find it ;-)
 
 Chris
 
 

-- 

___
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 )


Re: [Zope] DTML bug with database arrays in sqltest

2005-07-11 Thread David Pratt
This workaround is an excellent solution!  I am doing:

dtml-if an_arg>
and a_table.an_array_fieldt[dtml-sqlvar an_array_key type=int>][2] = dtml-sqlvar a_title type=string>
/dtml-if>

and just insert above any optional statements. Many thanks Dieter 

Regards,
David


On Sunday, July 10, 2005, at 06:59 PM, Dieter Maurer wrote:

David Pratt wrote at 2005-7-8 14:08 -0300:
...
dtml-and>
dtml-sqltest column=a_table.an_array_field[dtml-sqlvar 
an_array_key type=int>][2] name=a_title_var op=eq type=string 
optional>
. (rest of query)

The issue is how to test against these values when DTML cannot parse 
them?

You can emulate the dtml-sqltest with dtml-if and dtml-sqlvar
(or dtml-var).

-- 
Dieter

 ___
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 )


Re: [Zope] DTML bug with database arrays in sqltest

2005-07-10 Thread Dieter Maurer
David Pratt wrote at 2005-7-8 14:08 -0300:
 ...
dtml-and
 dtml-sqltest column=a_table.an_array_field[dtml-sqlvar 
an_array_key type=int][2] name=a_title_var op=eq type=string 
optional
. (rest of query)

The issue is how to test against these values when DTML cannot parse 
them?

You can emulate the dtml-sqltest with dtml-if and dtml-sqlvar
(or dtml-var).

-- 
Dieter
___
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 )


Re: [Zope] DTML bug with database arrays in sqltest

2005-07-08 Thread Jonathan



You cannot embed one dtml tag within another dtml 
tag.

A couple of possible work-arounds:

1) use a python script to return the values you 
need
2) create a python script which 'builds' a new dtml 
script and then execute the new script (ugly, but it works - not very efficient, 
so how often you run this will be a factor).

hth

Jonathan


  - Original Message - 
  From: 
  David 
  Pratt 
  To: zope@zope.org 
  Sent: Friday, July 08, 2005 1:08 PM
  Subject: [Zope] DTML bug with database 
  arrays in sqltest
  I am using arrays in Postgres. I need to be able to compare a 
  string value in a specific position of a text array field (text[] is a field 
  type in Postgres) against a variable(argument) I am passing to my query. I am 
  only using parts of the query to illustrate the problem as the rest is 
  irrelevant. I replaced the table, field names and arguments with names that 
  might make this more understandable.First. I am finding arrays work 
  fine with select statements in DTML when you use sqlvar to request a specific 
  value from the array. ie.SELECTa_table.an_array_field[dtml-sqlvar 
  some_value type="int"][2]FROM (rest of 
  query)But when you put them inside a sqltest tag for 
  evaluating values it throws an error because DTML cannot parse 
  it.ie.SELECT ...blah blah.dtml-anddtml-sqltest 
  column=a_table.an_array_field[dtml-sqlvar an_array_key type="int"][2] 
  name=a_title_var op="eq" type="string" optional. (rest of 
  query)The issue is how to test against these values when 
  DTML cannot parse them? My raw sql query works fine giving me the desired 
  results but I cannot construct the statement in DTML.The part of the 
  query that throws the error is the dtml-sqltest tag (it gives a parsing 
  error). 
  ie.dtml-anddtml-sqltest 
  column=a_db.an_array_field[dtml-sqlvar an_array_key type="int"][2] 
  name=a_title op="eq" type="string" optionalshould translate 
  to:ANDa_table.an_array_field[1][2] = 'This is a title' (This is a 
  valid _expression_ for Postgres)where an_array_key is a variable with 
  value of 1 and a_title is variable with a value of 'This is a title' 
  The above would give an invalid attribute name error for the 
  an_array_key (variable/argument).Is this a bug or is 
  there something else I ought to be doing? If this is a limitation of DTML, is 
  there a work around?Regards,David 
  
  
  

  ___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-announcehttp://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 )


Re: [Zope] DTML bug with database arrays in sqltest

2005-07-08 Thread David Pratt
Do you mean external methods with db api for 1)?

I find I can use a plain statement like this in DTML ... but I cannot make it conditional.  To bad you couldn't use ZPT instead to make ZSQL methods since it is XML or even some kind of XML schema just for making queries. It wouldn't have to be that rich to get pretty much all the SQL commands in it.  You could embed as well this way so long as it validated.

AND
 a_table.an_array_field[dtml-sqlvar an_array_key type=int>][2] = dtml-sqlvar an_array_key type=string>

For 2) I am not understanding how a new dtml will solve this?

Regards,
David

On Friday, July 8, 2005, at 02:16 PM, Jonathan wrote:

You cannot embed one dtml tag within another dtml tag.
 
A couple of possible work-arounds:
 
1) use a python script to return the values you need
2) create a python script which 'builds' a new dtml script and then execute the new script (ugly, but it works - not very efficient, so how often you run this will be a factor).
 
hth
 
Jonathan
___
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 )


Re: [Zope] dtml sessions

2005-06-19 Thread Tino Wildenhain
Am Sonntag, den 19.06.2005, 06:08 +0200 schrieb Andy Kim:
 No, I am not using the user system here.
 It is just a simple use.
 All I want is to put a session-conditional call for a dtml method within a
 simple page with this method.
 

if not REQUEST.SESSION.get(marker,):
yourcall()
REQUEST.SESSION.set(marker,call done)


transfer this to DTML or use a python script for coding
(since its easier)


___
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 )


Re: [Zope] dtml sessions

2005-06-18 Thread Andreas Jung



--On 18. Juni 2005 18:16:48 +0200 Andy Kim [EMAIL PROTECTED] wrote:


Hi,
I'm a beginner.
I'd like allow a dtml method call e.g. dtml-call method for one session
only. how do I do this with dtml?
could anyone help me?


What do you mean by that? Should it callable only once? If yes then of 
course use a flag which you can store inside the user session.


-aj


pgpCBAH46cC7a.pgp
Description: PGP signature
___
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 )


Re: [Zope] dtml sessions

2005-06-18 Thread Tino Wildenhain
Am Samstag, den 18.06.2005, 18:16 +0200 schrieb Andy Kim:
 Hi,
 I'm a beginner.
 I'd like allow a dtml method call e.g. dtml-call method for one session 
 only.
 how do I do this with dtml?
 could anyone help me?

How often are you going to ask this? :)

___
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 )


Re: [Zope] dtml sessions

2005-06-18 Thread Andy Kim
No, not just only once but rather for one browser session.
If the page is reloaded again the method shouldnt be called.
Only if the user comes for a next visit, the method should be called again.
It actually should be easy, I'm just not familiar with dtml programming yet.
However I'd like to have it with dtml since I have the dtml-call
method already using..

On 6/18/05, Andreas Jung [EMAIL PROTECTED] wrote:
 
 
 --On 18. Juni 2005 18:16:48 +0200 Andy Kim [EMAIL PROTECTED] wrote:
 
  Hi,
  I'm a beginner.
  I'd like allow a dtml method call e.g. dtml-call method for one session
  only. how do I do this with dtml?
  could anyone help me?
 
 What do you mean by that? Should it callable only once? If yes then of
 course use a flag which you can store inside the user session.
 
 -aj
 

___
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 )


Re: [Zope] dtml sessions

2005-06-18 Thread Dennis Allison

Ah ha!  you have as method that is supposed to be private to a particular 
user.   You should set the view permission for the method to be 
Authorized User and have the method test for the particular user and 
do nothing if the current user is not the right one.

A more general mechanism would be to create a local role for privileged 
users and set the view permission for the dtml-method to be that role.  
The you can give any user that role in acl_users and they will 
automagically have access rights to that method.

Good web design suggests that the navigation to this special method be 
controlled by the role as well so there's no button to push if the user
is not allowed to push the button.


On Sat, 18 Jun 2005, Andy Kim wrote:

 No, not just only once but rather for one browser session.
 If the page is reloaded again the method shouldnt be called.
 Only if the user comes for a next visit, the method should be called again.
 It actually should be easy, I'm just not familiar with dtml programming yet.
 However I'd like to have it with dtml since I have the dtml-call
 method already using..
 
 On 6/18/05, Andreas Jung [EMAIL PROTECTED] wrote:
  
  
  --On 18. Juni 2005 18:16:48 +0200 Andy Kim [EMAIL PROTECTED] wrote:
  
   Hi,
   I'm a beginner.
   I'd like allow a dtml method call e.g. dtml-call method for one session
   only. how do I do this with dtml?
   could anyone help me?
  
  What do you mean by that? Should it callable only once? If yes then of
  course use a flag which you can store inside the user session.
  
  -aj
  
 
 ___
 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 )
 

-- 
Dennis Allison * Computer Systems Laboratory * Gates 227
   * Stanford University *  Stanford CA  94305
   * (650) 723-9213 * (650) 723-0033 fax
   * [EMAIL PROTECTED]
   * [EMAIL PROTECTED]


___
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 )


Re: [Zope] dtml sessions

2005-06-18 Thread Tino Wildenhain
Am Samstag, den 18.06.2005, 18:43 +0200 schrieb Andy Kim:
 No, not just only once but rather for one browser session.
 If the page is reloaded again the method shouldnt be called.
 Only if the user comes for a next visit, the method should be called again.
 It actually should be easy, I'm just not familiar with dtml programming yet.
 However I'd like to have it with dtml since I have the dtml-call
 method already using..

I mixed you with Sungmook Kim, similar email address and
identical question on dzug mailinglist...

___
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 )


Re: [Zope] dtml sessions

2005-06-18 Thread Andy Kim
No, I am not using the user system here.
It is just a simple use.
All I want is to put a session-conditional call for a dtml method within a
simple page with this method.



- Original Message -
From: Dennis Allison [EMAIL PROTECTED]
To: Andy Kim [EMAIL PROTECTED]
Cc: Andreas Jung [EMAIL PROTECTED]; zope@zope.org
Sent: Saturday, June 18, 2005 6:58 PM
Subject: Re: [Zope] dtml sessions



 Ah ha!  you have as method that is supposed to be private to a particular
 user.   You should set the view permission for the method to be
 Authorized User and have the method test for the particular user and
 do nothing if the current user is not the right one.

 A more general mechanism would be to create a local role for privileged
 users and set the view permission for the dtml-method to be that role.
 The you can give any user that role in acl_users and they will
 automagically have access rights to that method.

 Good web design suggests that the navigation to this special method be
 controlled by the role as well so there's no button to push if the user
 is not allowed to push the button.


 On Sat, 18 Jun 2005, Andy Kim wrote:

  No, not just only once but rather for one browser session.
  If the page is reloaded again the method shouldnt be called.
  Only if the user comes for a next visit, the method should be called
again.
  It actually should be easy, I'm just not familiar with dtml programming
yet.
  However I'd like to have it with dtml since I have the dtml-call
  method already using..
 
  On 6/18/05, Andreas Jung [EMAIL PROTECTED] wrote:
  
  
   --On 18. Juni 2005 18:16:48 +0200 Andy Kim [EMAIL PROTECTED] wrote:
  
Hi,
I'm a beginner.
I'd like allow a dtml method call e.g. dtml-call method for one
session
only. how do I do this with dtml?
could anyone help me?
  
   What do you mean by that? Should it callable only once? If yes then of
   course use a flag which you can store inside the user session.
  
   -aj
  
  
  ___
  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 )
 

 --
 Dennis Allison * Computer Systems Laboratory * Gates 227
* Stanford University *  Stanford CA  94305
* (650) 723-9213 * (650) 723-0033 fax
* [EMAIL PROTECTED]
* [EMAIL PROTECTED]



___
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 )


Re: [Zope] DTML in Zope 2 vs Zope 3

2005-06-01 Thread Chris Withers

Remy Pinsonnault wrote:

I agree,

I find DTML great and s simple and clear.


Right. Then you've obviously never tried to figure out exactly where 
DTML is looking up a particular name ;-)


Chris

--
Simplistix - Content Management, Zope  Python Consulting
   - http://www.simplistix.co.uk

___
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 )


Re: [Zope] DTML in Zope 2 vs Zope 3

2005-05-30 Thread Ismet Dere
On 5/27/05, Hugo Ramos [EMAIL PROTECTED] wrote:
 On 5/27/05, Chris Withers [EMAIL PROTECTED] wrote:
  AT? As in ArcheTypes? You ARE kidding right? I've never seen such bad
  code, and in particular, abuse of ZPT in my entire life...
 
  And DTML sux, you wanna use it, fine, that says something about you. Use
  ZClasses, Plone, AT and XUF at the same time while you're at it. Why not
  dig out LoginManager and ZPatterns too, just for good measure?
 
  Hell, why not just do us all a favour and switch to using Perl where
  you'll be s much happier, and everyone in the community will agree
  with you rather than trying to help you not shoot yourself in the foot ;-)
 
 Is it me or are you really pissed??? :-)
 At least give DTML some credit... It's what made Zope so popular in
 the first days because of easy and fast learning curve!!!
 
 Regards
 Hugo
 

Yup, I completely agree with Hugo, dtml what made zope, zope.

Chris probably has a point as an advanced user but zope still needs a
lot of joe-beginners and their needs to be considered too.

ismet

 --
 Hugo Ramos - [EMAIL PROTECTED]
 ___
 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 )


Re: [Zope] DTML in Zope 2 vs Zope 3

2005-05-30 Thread Tino Wildenhain
Am Montag, den 30.05.2005, 13:05 +0800 schrieb Ismet Dere:
 I also like DTML a lot, found it way too easy to understand and simple to use.

I wonder how DTML is more easy then an equally simple
python expression in a script?
Lazy people should love ZPT since it saves a lot of typing
compared to DTML - otoh, a general rule seems to be: beginners
tend to write overly comlicated code.

 it was that simplicity of DTML that made me choose and use Zope over
 PHP in the first place.
 
 if dtml is to be phased out, Zope will be less attractive for new
 users then soon will be irrelevant no matter how sophisticated and
 advanced it may become.

No, it will not phased out. Neither in zope2 nor in zope3.


___
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 )


Re: [Zope] DTML in Zope 2 vs Zope 3

2005-05-30 Thread Garito

Ismet Dere escribió:


On 5/27/05, Hugo Ramos [EMAIL PROTECTED] wrote:
 


On 5/27/05, Chris Withers [EMAIL PROTECTED] wrote:
   


AT? As in ArcheTypes? You ARE kidding right? I've never seen such bad
code, and in particular, abuse of ZPT in my entire life...

And DTML sux, you wanna use it, fine, that says something about you. Use
ZClasses, Plone, AT and XUF at the same time while you're at it. Why not
dig out LoginManager and ZPatterns too, just for good measure?

Hell, why not just do us all a favour and switch to using Perl where
you'll be s much happier, and everyone in the community will agree
with you rather than trying to help you not shoot yourself in the foot ;-)
 


Is it me or are you really pissed??? :-)
At least give DTML some credit... It's what made Zope so popular in
the first days because of easy and fast learning curve!!!

Regards
Hugo

   



Yup, I completely agree with Hugo, dtml what made zope, zope.

Chris probably has a point as an advanced user but zope still needs a
lot of joe-beginners and their needs to be considered too.

ismet

 


--
Hugo Ramos - [EMAIL PROTECTED]
___
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 )
 

Sorry but, in my opinion, acquisition make zope, zope, products make 
zope zope, python make zope, zope but DTML, in my opinion, remember, is 
only a product


See ya

--
Mis Cosas
http://blogs.sistes.net/Garito/


___
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 )


Re: [Zope] DTML in Zope 2 vs Zope 3

2005-05-29 Thread Ismet Dere
I also like DTML a lot, found it way too easy to understand and simple to use.

it was that simplicity of DTML that made me choose and use Zope over
PHP in the first place.

if dtml is to be phased out, Zope will be less attractive for new
users then soon will be irrelevant no matter how sophisticated and
advanced it may become.

ismet

On 5/27/05, Greg Fischer [EMAIL PROTECTED] wrote:
 I am just curious, why is DTML not good?  It does 9 out of 10 things I
 want quite easily.  From my perspective, I really dont want to learn
 new ways of doing things if this works.  I also have no desire to do
 templating.  I can see the need for it in a large development shop,but
 for me, a 1 guy operation, I have no desire to complicate things.
 DTML works so easy for me.
 
 I do use Python scripts here and there for small and odd things that
 would be difficult or impossible to do in DTML, but like I said,
 that's maybe only 10% max of the functionality that I need to provide.
 (probably 5-6%) Having to move everything in Python is a hassle that I
 dont plan on doing for a few years.  I'll just keep using Zope 2.
 
 I'd also be curious to know from all you other developers, what
 percentage of tasks that you need to perform or functionality you need
 to provide can be provided simply with DTML?  Like for me, I can do
 quickly and easily do 90% of what I need in DTML.
 
 Is DTML really that much harder to use?
 
 I understand the whole idea of separating the logic and the
 presentation, and I guess, is that part of the reason why DTML is not
 as good?  But, for me, that separation is more complicated.  DTML is
 easier for me.  (partly because I know it)
 
 I dont know, DTML and the everythings an object concept in Zope are
 the very things that make Zope so attractive for a small time operator
 like me.  I hate to see them deprecated just because it doesnt work
 for the larger companies out there.  Of course, I may be totally
 ignorant about all this, huh?
 
 Anyway, starting to ramble...  Thanks for any thoughts.
 Greg
 
 On 5/26/05, Hugo Ramos [EMAIL PROTECTED] wrote:
  Yellow,
 
  I have the same feeling... Python should be the primary language used
  in Zope but let's not just cut the support on DTML leaving thousands
  out there spinning around and having to go into Python as fast as they
  can because DTML is not supported anymore.
  Changes take time... Getting used to Python only in Zope takes time...
  and I'm not so sure the employers out there are that kind allowing
  everybody to take time making the move.
 
 
  Regards
  Hugo
 
 
  On 5/26/05, David H [EMAIL PROTECTED] wrote:
   Hugo Ramos wrote:
  
   Yellow,
   
   I think because of lazy people like me that prefer to use DTML in a
   fast way than go into a deep Python level to get the job done...
   I know that, eventually, one of these days I'll have to move on to
   Python only but until that day comes... DTML and a little bit of
   Python where needed suits me fine! :-)
   
   Regards
   Hugo
   
   
   
   Hugo,
   I figured as a dtml wiz a few years ago.  Now I can't image doing
   w/out python scripts and suddenly DTML gives me a headache.  I do think
   that DTML deserves a Hall of Fame Award but its time to move on.
  
   David
  
  
  
  
 
 
  --
  Hugo Ramos - [EMAIL PROTECTED]
  ___
  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 )
 
 
 
 --
 Greg Fischer
 1st Byte Solutions
 http://www.1stbyte.com
 ___
 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 )


Re: [Zope] DTML in Zope 2 vs Zope 3

2005-05-29 Thread Andreas Jung



--On 30. Mai 2005 13:05:31 +0800 Ismet Dere [EMAIL PROTECTED] wrote:


if dtml is to be phased out, Zope will be less attractive for new
users then soon will be irrelevant no matter how sophisticated and
advanced it may become.


There are no plans to phase DTML out - neither in Zope 2 nor in Zope 3 as 
far

as I know. If you want or need to use DTML - just use it. In general people
are strongly encouraged to use ZPT for any kind of templates and use DTML
only there where necessary e.g. when you want to create non-HTML/XML 
documents

inside Zope..but in general ZPT is the preferred way to go.

-aj




pgpwA3TO88B4S.pgp
Description: PGP signature
___
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 )


Re: [Zope] DTML in Zope 2 vs Zope 3

2005-05-28 Thread David H

Andrew Milton wrote:


+---[ Jonathan Cyr ]--
| Damn users, using all this imperfect software. These Kids Today!  ;-)
| 
| Easy Big Fella, Whooa.
| 

You must be new here We've all learnt to ignore Chris... 


He gets easily confused... or maybe he doesn't take his medication... not
sure, but, ignoring him generally works for the best d8)

 



Actually as a member of scorched by Chris club I find his acid wit 
funny.  Plus he has contributed alot to the community and has answered 
endless questions. 


David

___
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 )


Re: [Zope] DTML in Zope 2 vs Zope 3

2005-05-27 Thread Tino Wildenhain
Am Freitag, den 27.05.2005, 00:20 +0200 schrieb Jaroslav Lukesh:
...
 I absolutelly agree with you, it is like my words.
 
 But separation of logic and presentation could be done successfully in DTML
 too. ZPT, which have separation argument is not as easy to make totally

This is even somewhat correct. If people had the discipline to not abuse
the templating to do complicated logic. 
The major drawbacks of DTML are: 

- one namespace (with transparent layers)
- confusing naming of tags, like dtml-var which
  really is dtml-print or something
- and the extra tags for flow control, but probably
  the dtml fans can live with it.
- peoples practice to use dtml-var foo even inside
  html-tags attributes, where dtml-foo; should be used.

 separated design as marketing says, for example see Plone - try to customize
 plone site to absolutelly different custom design - it is near impossible.

Unfortunately Plone is still a bad example for ZPT. It is getting
better but still it has a lot of code and definition in the templates.
Maybe AT would be a way out.

___
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 )


Re: [Zope] DTML in Zope 2 vs Zope 3

2005-05-27 Thread Greg Fischer
Wow, thanks for the replies guys.  It's good to hear I am not the only
one who likes DTML.

Tino, thanks for the explanations.  I have some thoughts below on
that, and keep in mind, I am questioning from my own ignorance.

Tino Wrote:
 The major drawbacks of DTML are:
 
 - one namespace (with transparent layers)  
One namespace?  Why do you need more?  I havent had any problems with
one.  Can you give some examples of why this is important or how it
would be useful?

 - confusing naming of tags, like dtml-var which
   really is dtml-print or something
Well I realize that it could be named something else, but it never
occured to me.  I dont think it's confusing.  I mean, in DTML you use
4 tags more than any other, IN, VAR, IF, and CALL.  Simple.  And if
there is one thing I have learned over the few years I have been
programming, it is to keep it simple. Simple works.

 - and the extra tags for flow control, but probably
   the dtml fans can live with it.
Yeah, simple.  We can live with it, particularly since we can call
more detailed functionality from Python.

 - peoples practice to use dtml-var foo even inside
   html-tags attributes, where dtml-foo; should be used.
Hmm.. Never thought of that one as I too just use the full dtml-var
foo.  I can see now that it might make readability a little better to
use dtml, but is there a technical reason for using it that way?

Thank you again for your input Tino.  I can understand the need to
take Zope to another level, its the nature of things to keep them
growing.  And changing Zope to fit the needs of large scale
applications is good, I just hate to see the sacrifice of the smaller
apps needs.  I probably will never get to work on enterprise class
systems, in fact I really dont want to, but Zope works beautifully for
the small web apps and that's what I want to work on.  I wonder what
the ratio is of Zope users who use small apps to those who do large
apps?

Thanks again!

Greg

On 5/26/05, Tino Wildenhain [EMAIL PROTECTED] wrote:
 Am Freitag, den 27.05.2005, 00:20 +0200 schrieb Jaroslav Lukesh:
 ...
  I absolutelly agree with you, it is like my words.
 
  But separation of logic and presentation could be done successfully in DTML
  too. ZPT, which have separation argument is not as easy to make totally
 
 This is even somewhat correct. If people had the discipline to not abuse
 the templating to do complicated logic.
 The major drawbacks of DTML are:
 
 - one namespace (with transparent layers)
 - confusing naming of tags, like dtml-var which
   really is dtml-print or something
 - and the extra tags for flow control, but probably
   the dtml fans can live with it.
 - peoples practice to use dtml-var foo even inside
   html-tags attributes, where dtml-foo; should be used.
 
  separated design as marketing says, for example see Plone - try to customize
  plone site to absolutelly different custom design - it is near impossible.
 
 Unfortunately Plone is still a bad example for ZPT. It is getting
 better but still it has a lot of code and definition in the templates.
 Maybe AT would be a way out.
 
 ___
 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 )
 


-- 
Greg Fischer
1st Byte Solutions
http://www.1stbyte.com
___
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 )


Re: [Zope] DTML in Zope 2 vs Zope 3

2005-05-27 Thread Chris Withers

Tino Wildenhain wrote:

Unfortunately Plone is still a bad example for ZPT. It is getting
better but still it has a lot of code and definition in the templates.
Maybe AT would be a way out.


AT? As in ArcheTypes? You ARE kidding right? I've never seen such bad 
code, and in particular, abuse of ZPT in my entire life...


And DTML sux, you wanna use it, fine, that says something about you. Use 
ZClasses, Plone, AT and XUF at the same time while you're at it. Why not 
dig out LoginManager and ZPatterns too, just for good measure?


Hell, why not just do us all a favour and switch to using Perl where 
you'll be s much happier, and everyone in the community will agree 
with you rather than trying to help you not shoot yourself in the foot ;-)


cheers,

Chris

--
Simplistix - Content Management, Zope  Python Consulting
   - http://www.simplistix.co.uk

___
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 )


Re: [Zope] DTML in Zope 2 vs Zope 3

2005-05-27 Thread Hugo Ramos
On 5/27/05, Chris Withers [EMAIL PROTECTED] wrote:
 AT? As in ArcheTypes? You ARE kidding right? I've never seen such bad
 code, and in particular, abuse of ZPT in my entire life...
 
 And DTML sux, you wanna use it, fine, that says something about you. Use
 ZClasses, Plone, AT and XUF at the same time while you're at it. Why not
 dig out LoginManager and ZPatterns too, just for good measure?
 
 Hell, why not just do us all a favour and switch to using Perl where
 you'll be s much happier, and everyone in the community will agree
 with you rather than trying to help you not shoot yourself in the foot ;-)

Is it me or are you really pissed??? :-)
At least give DTML some credit... It's what made Zope so popular in
the first days because of easy and fast learning curve!!!

Regards
Hugo

-- 
Hugo Ramos - [EMAIL PROTECTED]
___
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 )


Re: [Zope] DTML in Zope 2 vs Zope 3

2005-05-27 Thread Lennart Regebro
On 5/26/05, Greg Fischer [EMAIL PROTECTED] wrote:
 Is DTML really that much harder to use?

Nah, but it's uglier. Also, the idea is that a web editor that
confirms to the tsandard of ignoring things it doens't understand,
should in theory be usable with TAL, but not with DTML. In practice,
however, HTML editors don't do that.

 I understand the whole idea of separating the logic and the
 presentation, and I guess, is that part of the reason why DTML is not
 as good?  

Well, it used to be. But logic crept into ZPTs as well. The good thing
is to set up all the data in a python script or python method, and
then use the template only to display this data. Zope3 has this
separation built-in, when you create a page with a template it
automatically gets connected to a view which is a python class, and
you can specify your own custom view and set up the data there.

In Zope 2 you have to call a script that creates the data, or
reversely, use the script as the main view and let it call the
template. (I don't know how easy that last thing is with DTML, but the
first one works).

If you do this, the drawbacks of DTML becomes much less painful.
-- 
Lennart Regebro, Nuxeo http://www.nuxeo.com/
CPS Content Management http://www.cps-project.org/
___
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 )


Re: [Zope] DTML in Zope 2 vs Zope 3

2005-05-27 Thread Greg Fischer
Using DTML from WYSIWYG editors is definitely a drawback.  But, how
many of us use them for doing our work?  I might use Dreamweaver to
clean up my sliced web template, but soon as I start my Zope work,
it's all Crimson Editor coding by hand to Zope.  Using Dreamweaver
actually slows me down, it's easier to just code it.  However, from a
newbie perspective, not being able to run my Zope content in my fancy,
drag'n'drop editor really bugged me a long time a go.

Saying DTML sucks is only stating your difference of oppinion.  At
least give us some insight as to why it sucks.  Technical, usability,
or even marketing reasons would be helpful.  But, come on DUH? 
Everybody will have their preference of languages, and even the way
they like to layout the code.  So I understand that some of us like
DTML and some dont.

All that aside, DTML may be ugly, but I dont agree.  I guess beauty is
in the eye of the beholder. :)

Well, aside from the fact that you cant use DTML in WYSIWYG editors, I
still dont understand why it is not good.  If it is simple, easy to
use, and it does the job, and I suppose, if you prefer it, why is it
not good to use?

I've beaten this subject to death, so time to move on.
Thanks for hearing me out.
Greg

On 5/27/05, Lennart Regebro [EMAIL PROTECTED] wrote:
 On 5/26/05, Greg Fischer [EMAIL PROTECTED] wrote:
  Is DTML really that much harder to use?
 
 Nah, but it's uglier. Also, the idea is that a web editor that
 confirms to the tsandard of ignoring things it doens't understand,
 should in theory be usable with TAL, but not with DTML. In practice,
 however, HTML editors don't do that.
 
  I understand the whole idea of separating the logic and the
  presentation, and I guess, is that part of the reason why DTML is not
  as good?
 
 Well, it used to be. But logic crept into ZPTs as well. The good thing
 is to set up all the data in a python script or python method, and
 then use the template only to display this data. Zope3 has this
 separation built-in, when you create a page with a template it
 automatically gets connected to a view which is a python class, and
 you can specify your own custom view and set up the data there.
 
 In Zope 2 you have to call a script that creates the data, or
 reversely, use the script as the main view and let it call the
 template. (I don't know how easy that last thing is with DTML, but the
 first one works).
 
 If you do this, the drawbacks of DTML becomes much less painful.
 --
 Lennart Regebro, Nuxeo http://www.nuxeo.com/
 CPS Content Management http://www.cps-project.org/
 


-- 
Greg Fischer
1st Byte Solutions
http://www.1stbyte.com
___
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 )


Re: [Zope] DTML in Zope 2 vs Zope 3

2005-05-27 Thread Lennart Regebro
On 5/27/05, Greg Fischer [EMAIL PROTECTED] wrote:
 Well, aside from the fact that you cant use DTML in WYSIWYG editors, I
 still dont understand why it is not good.  

Well, the fact that you get everyting directly into the current
namespace, especially with DTML-in, and things like that, is the real
problem. But as noted, by making all data-gathering in a python
script, the problems with this are less and survivable.

-- 
Lennart Regebro, Nuxeo http://www.nuxeo.com/
CPS Content Management http://www.cps-project.org/
___
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 )


Re: [Zope] DTML in Zope 2 vs Zope 3

2005-05-27 Thread Greg Fischer
Ah you are right.  Just occured to me.  That is kind of a pain in
DTML, but I've learned how to deal with it.  Makes sense.

If I already have an object, say from a form submitted, in the REQUEST
namespace, and I then retrieve data from sql and a column has the same
name, I will have an issue.  Which one is going to display in my var?

I deal with this particular issue by changing my zsql method to return
the column name differently, but there are other times when this may
arise and it is a problem. And this causes you to have to do a bunch
of messy dtml-call REQUEST.set's to set your vars correctly.

I have learned how to deal with these things, but you are right, this
is a problem with DTML and I can see how this exact issue helps make
DTML messy and a little confusing.  Great point.  Thanks.

Greg

On 5/27/05, Lennart Regebro [EMAIL PROTECTED] wrote:
 On 5/27/05, Greg Fischer [EMAIL PROTECTED] wrote:
  Well, aside from the fact that you cant use DTML in WYSIWYG editors, I
  still dont understand why it is not good.
 
 Well, the fact that you get everyting directly into the current
 namespace, especially with DTML-in, and things like that, is the real
 problem. But as noted, by making all data-gathering in a python
 script, the problems with this are less and survivable.
 
 --
 Lennart Regebro, Nuxeo http://www.nuxeo.com/
 CPS Content Management http://www.cps-project.org/
 


-- 
Greg Fischer
1st Byte Solutions
http://www.1stbyte.com
___
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 )


Re: [Zope] DTML in Zope 2 vs Zope 3

2005-05-27 Thread Jonathan Cyr




Damn users, using all this
imperfect software. These Kids Today!
;-) 

Easy Big Fella, Whooa.

-Jon



Chris Withers wrote:
Tino
Wildenhain wrote:
  
  Unfortunately Plone is still a bad example
for ZPT. It is getting

better but still it has a lot of code and definition in the templates.

Maybe AT would be a way out.

  
  
AT? As in ArcheTypes? You ARE kidding right? I've never seen such bad
code, and in particular, abuse of ZPT in my entire life...
  
  
And DTML sux, you wanna use it, fine, that says something about you.
Use ZClasses, Plone, AT and XUF at the same time while you're at it.
Why not dig out LoginManager and ZPatterns too, just for good measure?
  
  
Hell, why not just do us all a favour and switch to using Perl where
you'll be s much happier, and everyone in the community will agree
with you rather than trying to help you not shoot yourself in the foot
;-)
  
  
cheers,
  
  
Chris
  
  



___
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 )


Re: [Zope] DTML in Zope 2 vs Zope 3

2005-05-27 Thread Andrew Milton
+---[ Jonathan Cyr ]--
| Damn users, using all this imperfect software. These Kids Today!  ;-)
| 
| Easy Big Fella, Whooa.
| 

You must be new here We've all learnt to ignore Chris... 

He gets easily confused... or maybe he doesn't take his medication... not
sure, but, ignoring him generally works for the best d8)

-- 
Andrew Milton
[EMAIL PROTECTED]
___
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 )


Re: [Zope] DTML in Zope 2 vs Zope 3

2005-05-26 Thread Chris Withers

David H wrote:


I understand that DTML will be in Zope 3.  My question is, do 
namespaces and context also migrate to Zope 3? If not, could break 
existing code?


I would suggest that the chances of any DTML from Zope 2 working in Zope 
3 are slim, at best ;-)


Why DTML is IN Zope 3 in the first place is totally beyond me...

Chris

--
Simplistix - Content Management, Zope  Python Consulting
   - http://www.simplistix.co.uk

___
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 )


Re: [Zope] DTML in Zope 2 vs Zope 3

2005-05-26 Thread Hugo Ramos
Yellow,

I think because of lazy people like me that prefer to use DTML in a
fast way than go into a deep Python level to get the job done...
I know that, eventually, one of these days I'll have to move on to
Python only but until that day comes... DTML and a little bit of
Python where needed suits me fine! :-)

Regards
Hugo


On 5/25/05, Chris Withers [EMAIL PROTECTED] wrote:
 David H wrote:
 
  I understand that DTML will be in Zope 3.  My question is, do
  namespaces and context also migrate to Zope 3? If not, could break
  existing code?
 
 I would suggest that the chances of any DTML from Zope 2 working in Zope
 3 are slim, at best ;-)
 
 Why DTML is IN Zope 3 in the first place is totally beyond me...
 
 Chris
 
 --
 Simplistix - Content Management, Zope  Python Consulting
 - http://www.simplistix.co.uk
 
 ___
 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 )
 


-- 
Hugo Ramos - [EMAIL PROTECTED]
___
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 )


Re: [Zope] DTML in Zope 2 vs Zope 3

2005-05-26 Thread David H

Hugo Ramos wrote:


Yellow,

I think because of lazy people like me that prefer to use DTML in a
fast way than go into a deep Python level to get the job done...
I know that, eventually, one of these days I'll have to move on to
Python only but until that day comes... DTML and a little bit of
Python where needed suits me fine! :-)

Regards
Hugo

 


Hugo,
I figured as a dtml wiz a few years ago.  Now I can't image doing 
w/out python scripts and suddenly DTML gives me a headache.  I do think 
that DTML deserves a Hall of Fame Award but its time to move on.


David



___
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 )


Re: [Zope] DTML in Zope 2 vs Zope 3

2005-05-26 Thread Hugo Ramos
Yellow,

I have the same feeling... Python should be the primary language used
in Zope but let's not just cut the support on DTML leaving thousands
out there spinning around and having to go into Python as fast as they
can because DTML is not supported anymore.
Changes take time... Getting used to Python only in Zope takes time...
and I'm not so sure the employers out there are that kind allowing
everybody to take time making the move.


Regards
Hugo


On 5/26/05, David H [EMAIL PROTECTED] wrote:
 Hugo Ramos wrote:
 
 Yellow,
 
 I think because of lazy people like me that prefer to use DTML in a
 fast way than go into a deep Python level to get the job done...
 I know that, eventually, one of these days I'll have to move on to
 Python only but until that day comes... DTML and a little bit of
 Python where needed suits me fine! :-)
 
 Regards
 Hugo
 
 
 
 Hugo,
 I figured as a dtml wiz a few years ago.  Now I can't image doing
 w/out python scripts and suddenly DTML gives me a headache.  I do think
 that DTML deserves a Hall of Fame Award but its time to move on.
 
 David
 
 
 
 


-- 
Hugo Ramos - [EMAIL PROTECTED]
___
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 )


  1   2   3   4   >