Re: [Zope] How can i call a pyhton module's function from with in Page Temmplates?

2005-10-18 Thread Thomas G. Apostolou
Αρχικό μήνυμα από  Chris Withers <[EMAIL PROTECTED]>:

> Thomas G. Apostolou wrote:
> > 
> >   
> > 
> >   
> > 
> >   
> >   
> >  
> >   
> >   
> > 
> 
> What Tino said about using a database adapter is true, but even if
> you 
> want to stick with your external method, you can always use the 
> following ZPT:
> 
>  
> tal:attributes="python:test(path('repeat/data/odd'),'odd','even')"
>tal:content="cell">
>
> 
> 
> You only need to figure out where sysDSN, usr, mypass, sTable and 
> sFields come from. Your example being in DTML, I have no idea ;-)

sysDSN, usr, mypass are properties with values of a folder object witch
i use with aquisition to call the DTML Method trough it.
sTable and sFields are input fields of the form that calls the DTML
Method and submits its values


Thomas G. Apostolou
Software Engineer
Θωμάς Γ. Αποστόλου
Μηχανικός Λογισμικού
___
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] How can i call a pyhton module's function from with in Page Temmplates?

2005-10-18 Thread Chris Withers

Thomas G. Apostolou wrote:


  

  

  
  
 
  
  



What Tino said about using a database adapter is true, but even if you 
want to stick with your external method, you can always use the 
following ZPT:



  


You only need to figure out where sysDSN, usr, mypass, sTable and 
sFields come from. Your example being in DTML, I have no idea ;-)


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] How can i call a pyhton module's function from with in Page Temmplates?

2005-10-17 Thread Tino Wildenhain

Thomas G. Apostolou schrieb:

Αρχικό μήνυμα από  Chris Withers <[EMAIL PROTECTED]>:



Thomas Apostolou wrote:


i saw that from within a DTML Method one is able to
call a fuction of a python module in the file system.


I don't think so...



Well, you are right. I do not directly call the modules's function from
the file system.
I call an External Method that "wraps" the module's function and then i
call that External Method from my DTML Method. Here is the example:


  

  

  
  
 
  
  



GetData is the name of the External Method i call with the parameters of
the module's function as you can see.



Dont do that. Use a Database adaptor instead - any maybe issue
the query there if you dont want the ZSQL-Resultset-wrapping.
The reason is, ZDAs take care of pooling and so on and you avoid
a per thread reconnection.

___
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] How can i call a pyhton module's function from with in Page Temmplates?

2005-10-17 Thread Thomas G. Apostolou
Αρχικό μήνυμα από  Chris Withers <[EMAIL PROTECTED]>:

> Thomas Apostolou wrote:
> > i saw that from within a DTML Method one is able to
> > call a fuction of a python module in the file system.
> 
> I don't think so...

Well, you are right. I do not directly call the modules's function from
the file system.
I call an External Method that "wraps" the module's function and then i
call that External Method from my DTML Method. Here is the example:


  

  

  
  
 
  
  



GetData is the name of the External Method i call with the parameters of
the module's function as you can see.



> 
> > Now i want to get the funtion's results from within a
> > Page Template.
> 
> Which function? Give us an example of what you've tried...
> 
> > Is the right way to make a Script(Python) that calls
> > this module's function and then call this
> > Script(Python) from within my Page Template?
> 
> You should be able to make the call direct from the ZPT, but you'll
> have 
> to tell us what you're trying to do...
> 
> 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 )
> 
> 


Thomas G. Apostolou
Software Engineer
Θωμάς Γ. Αποστόλου
Μηχανικός Λογισμικού
___
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] How can i call a pyhton module's function from with in Page Temmplates?

2005-10-14 Thread Chris Withers

Thomas Apostolou wrote:

i saw that from within a DTML Method one is able to
call a fuction of a python module in the file system.


I don't think so...


Now i want to get the funtion's results from within a
Page Template.


Which function? Give us an example of what you've tried...


Is the right way to make a Script(Python) that calls
this module's function and then call this
Script(Python) from within my Page Template?


You should be able to make the call direct from the ZPT, but you'll have 
to tell us what you're trying to do...


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] How can i call a pyhton module's function from with in Page Temmplates?

2005-10-12 Thread Peter Bengtsson
If you already know DTML but need to learn ZPTs I suggest you have a
look at this old document
http://www.zope.org/Members/peterbe/DTML2ZPT

2005/10/12, Thomas Apostolou <[EMAIL PROTECTED]>:
> Hello,
>
> i saw that from within a DTML Method one is able to
> call a fuction of a python module in the file system.
>
> Now i want to get the funtion's results from within a
> Page Template.
> Is the right way to make a Script(Python) that calls
> this module's function and then call this
> Script(Python) from within my Page Template?
> Is there any other less nifty way to do this?
>
> Thanks in advance.
>
>
>
>
>
>
> ___
> Χρησιμοποιείτε 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 )
>


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


[Zope] How can i call a pyhton module's function from with in Page Temmplates?

2005-10-12 Thread Thomas Apostolou
Hello,

i saw that from within a DTML Method one is able to
call a fuction of a python module in the file system.

Now i want to get the funtion's results from within a
Page Template.
Is the right way to make a Script(Python) that calls
this module's function and then call this
Script(Python) from within my Page Template?
Is there any other less nifty way to do this?

Thanks in advance.






___ 
Χρησιμοποιείτε 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 )