[Zope] Passing parameters using DTML

2005-06-17 Thread John Poltorak
Can someone provide an example of passing parameters using DTML?

I'm sure this must be doable, but don't see an example in the Zope Book.

I assume it would go something like



but how would var1 pick up parm1 parm2?

-- 
John



___
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] Passing parameters using DTML

2005-06-17 Thread Tino Wildenhain
Am Freitag, den 17.06.2005, 09:44 +0100 schrieb John Poltorak:
> Can someone provide an example of passing parameters using DTML?
> 
> I'm sure this must be doable, but don't see an example in the Zope Book.
> 
> I assume it would go something like
> 
> 
> 
> but how would var1 pick up parm1 parm2?

Not at all. You could either have tried
it out ;) Or looked at the DTML documentation
in the Zope book *wink* ;)



If you are learning anyway, why not skip the DTML
part for now and go strait python-scripts and ZPT?

-- 
Tino Wildenhain <[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] automagic reindexing of objects

2005-06-17 Thread Jürgen Herrmann
hi all!

i make heavy use of indexes in my extension classes. these all inherit
from catalogpathaware, so i have to call object.reindex_object() on
each changed instance. calling it from attribute getters/setters f.ex.
is not a good idea, because changing 3 attributes will reindex the object
3 times.

what i'd like to have is that such objects are reindexed automatically
before comitting a transaction.

is it possible? where should i start looking in the source, is there
possibly a before_transaction_commit hook?

regards, juergen herrmann
___

>> XLhost.de - eXperts in Linux hosting <<

Juergen Herrmann
Weiherweg 10, 93051 Regensburg, Germany
Fon:  +49 (0)700 XLHOSTDE [0700 95467833]
Fax:  +49 (0)721 151 463027

ICQ:  27139974  -  IRC: [EMAIL PROTECTED]
WEB:  http://www.XLhost.de
___
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] automagic reindexing of objects

2005-06-17 Thread Jonathan


- Original Message - 
From: "Jürgen Herrmann" <[EMAIL PROTECTED]>

i make heavy use of indexes in my extension classes. these all inherit
from catalogpathaware, so i have to call object.reindex_object() on
each changed instance. calling it from attribute getters/setters f.ex.
is not a good idea, because changing 3 attributes will reindex the object
3 times.

what i'd like to have is that such objects are reindexed automatically
before comitting a transaction.


You can't index before committing.  I think you need a different strategy: 
how about creating all of the new objects and then call the catalog/indexing 
mechanism.  We do this for one of our large volume catalogs (1m+ records), 
by having an object class/catalog that are not 'aware' and then manually 
(well, thru a python routine) cataloging/indexing the objects.


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] automagic reindexing of objects

2005-06-17 Thread Jürgen Herrmann

[ Jonathan wrote:]
>
> - Original Message -
> From: "Jürgen Herrmann" <[EMAIL PROTECTED]>
>> i make heavy use of indexes in my extension classes. these all inherit
>> from catalogpathaware, so i have to call object.reindex_object() on
>> each changed instance. calling it from attribute getters/setters f.ex.
>> is not a good idea, because changing 3 attributes will reindex the
>> object
>> 3 times.
>>
>> what i'd like to have is that such objects are reindexed automatically
>> before comitting a transaction.
>
> You can't index before committing.  I think you need a different strategy:
> how about creating all of the new objects and then call the
> catalog/indexing
> mechanism.  We do this for one of our large volume catalogs (1m+ records),
> by having an object class/catalog that are not 'aware' and then manually
> (well, thru a python routine) cataloging/indexing the objects.

hmm, it's not about newly created objects. i want to have automatic
REindexing, in cleartext - i want to make it easy for the programmer:
he/she should just call an attribute setter or maybe change a relation
and just before the transaction would be committed to the storage, i'd
like to cycle through all dirty objects and reindex them, if they're
catalogpathaware (or implement reindex_object()...).

>
> HTH
>
> Jonathan

juergen
___

>> XLhost.de - eXperts in Linux hosting <<

Juergen Herrmann
Weiherweg 10, 93051 Regensburg, Germany
Fon:  +49 (0)700 XLHOSTDE [0700 95467833]
Fax:  +49 (0)721 151 463027

ICQ:  27139974  -  IRC: [EMAIL PROTECTED]
WEB:  http://www.XLhost.de
___
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] Getting information about current method

2005-06-17 Thread Jan-Ole Esleben
Hi!

I am new to this list and rather new to Zope, so maybe this is a
stupid question; unfortunately I haven't been able to find an answer
to it anywhere:

is there a generic way to find out from Python code which method has
been called (in other words: find out where the current method is
located in the ZOPE hierarchy and what its name is)? If I call an
External Method via a DTML method, of course the REQUEST object
contains the path to the DTML method because the External Method
hasn't been called via HTTP. I haven't been able to figure out any
other way of getting this information.

Thanks in advance,
Ole
___
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] automagic reindexing of objects

2005-06-17 Thread Peter Bengtsson
Personally I think one should stay the hell away from transactions.
They're not for you to fiddle with.
I understand your question and even though I think it's a bit crazy I
can see a benefit (simplicity for the programmer).

How about a trickery solution like this:

class CatalogPathAware:
def index_object(self, *a, **k):
print self.__class__.__name__, "in for indexing!"

class _MyProduct(CatalogPathAware):
def __init__(self, id, title=''):
self.id = id
self.title = title
def setTitle(self, title):
# could be much more complicated
self.title = title

class MyProduct(_MyProduct):
def setTitle(self, title):
_MyProduct.setTitle(self, title)
self.index_object()

inst = MyProduct("instanceA")
inst.setTitle('Peter')

print inst.title


You would basically rename your existing class from "Whatever" to
"_Whatever" and continue as before. This does mean however that you
have to explicitly write a function for each setter.

On 6/17/05, Jürgen Herrmann <[EMAIL PROTECTED]> wrote:
> 
> [ Jonathan wrote:]
> >
> > - Original Message -
> > From: "Jürgen Herrmann" <[EMAIL PROTECTED]>
> >> i make heavy use of indexes in my extension classes. these all inherit
> >> from catalogpathaware, so i have to call object.reindex_object() on
> >> each changed instance. calling it from attribute getters/setters f.ex.
> >> is not a good idea, because changing 3 attributes will reindex the
> >> object
> >> 3 times.
> >>
> >> what i'd like to have is that such objects are reindexed automatically
> >> before comitting a transaction.
> >
> > You can't index before committing.  I think you need a different strategy:
> > how about creating all of the new objects and then call the
> > catalog/indexing
> > mechanism.  We do this for one of our large volume catalogs (1m+ records),
> > by having an object class/catalog that are not 'aware' and then manually
> > (well, thru a python routine) cataloging/indexing the objects.
> 
> hmm, it's not about newly created objects. i want to have automatic
> REindexing, in cleartext - i want to make it easy for the programmer:
> he/she should just call an attribute setter or maybe change a relation
> and just before the transaction would be committed to the storage, i'd
> like to cycle through all dirty objects and reindex them, if they're
> catalogpathaware (or implement reindex_object()...).
> 
> >
> > HTH
> >
> > Jonathan
> 
> juergen
> ___
> 
> >> XLhost.de - eXperts in Linux hosting <<
> 
> Juergen Herrmann
> Weiherweg 10, 93051 Regensburg, Germany
> Fon:  +49 (0)700 XLHOSTDE [0700 95467833]
> Fax:  +49 (0)721 151 463027
> 
> ICQ:  27139974  -  IRC: [EMAIL PROTECTED]
> WEB:  http://www.XLhost.de
> ___
> 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] Getting information about current method

2005-06-17 Thread Peter Bengtsson
On 6/17/05, Jan-Ole Esleben <[EMAIL PROTECTED]> wrote:
> Hi!
> 
> I am new to this list and rather new to Zope, so maybe this is a
> stupid question; unfortunately I haven't been able to find an answer
> to it anywhere:
> 
> is there a generic way to find out from Python code which method has
> been called (in other words: find out where the current method is
> located in the ZOPE hierarchy and what its name is)? If I call an
> External Method via a DTML method, of course the REQUEST object
> contains the path to the DTML method because the External Method
> hasn't been called via HTTP. I haven't been able to figure out any
> other way of getting this information.
> 
I don't get it. Do you want to know the name of the DTML method from
inside the External method?
Perhaps I'll be able to help if you tell us more about the intention
of this code.


> Thanks in advance,
> Ole
> ___
> 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] Getting information about current method

2005-06-17 Thread Jan-Ole Esleben
I want to know the name (and path) of the _External Method_ from
inside it. What I _can_ get is the name of the DTML method.

I want to build generic scaffolding code for functions that
conditionally redispatch as asynchronous calls (via ZASync); that
part, however, isn't a problem at all - everything works fine as long
as I use an HTTP request directly and redispatch with information from
the REQUEST. The problem is that I need a TALES expression to call the
function again (asynchronously this time), and for that I need the
ZOPE path to it.

Ole

2005/6/17, Peter Bengtsson <[EMAIL PROTECTED]>:
> > is there a generic way to find out from Python code which method has
> > been called (in other words: find out where the current method is
> > located in the ZOPE hierarchy and what its name is)? If I call an
> > External Method via a DTML method, of course the REQUEST object
> > contains the path to the DTML method because the External Method
> > hasn't been called via HTTP. I haven't been able to figure out any
> > other way of getting this information.
> >
> I don't get it. Do you want to know the name of the DTML method from
> inside the External method?
> Perhaps I'll be able to help if you tell us more about the intention
> of this code.
> 
> > Thanks in advance,
> > Ole
> > ___
> > 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] automagic reindexing of objects

2005-06-17 Thread Jürgen Herrmann

[ Peter Bengtsson wrote:]
> Personally I think one should stay the hell away from transactions.
> They're not for you to fiddle with.
> I understand your question and even though I think it's a bit crazy I
> can see a benefit (simplicity for the programmer).
>
> How about a trickery solution like this:
>
> class CatalogPathAware:
> def index_object(self, *a, **k):
> print self.__class__.__name__, "in for indexing!"
>
> class _MyProduct(CatalogPathAware):
> def __init__(self, id, title=''):
> self.id = id
> self.title = title
> def setTitle(self, title):
> # could be much more complicated
> self.title = title
>
> class MyProduct(_MyProduct):
> def setTitle(self, title):
> _MyProduct.setTitle(self, title)
> self.index_object()
>
> inst = MyProduct("instanceA")
> inst.setTitle('Peter')
>
> print inst.title
>
>
> You would basically rename your existing class from "Whatever" to
> "_Whatever" and continue as before. This does mean however that you
> have to explicitly write a function for each setter.
>
hmm, i can't see how this would help. if i call index_object in every
attribute getter method, the indexing is done possibly several times,
unnecessary and (cpu)time consuming.

juergen
___

>> XLhost.de - eXperts in Linux hosting <<

Juergen Herrmann
Weiherweg 10, 93051 Regensburg, Germany
Fon:  +49 (0)700 XLHOSTDE [0700 95467833]
Fax:  +49 (0)721 151 463027

ICQ:  27139974  -  IRC: [EMAIL PROTECTED]
WEB:  http://www.XLhost.de
___
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] Call of TAL interpreter

2005-06-17 Thread Simon ALEXANDRE








Hello

 

Someone could tell me where I could find in Zope the
following call :

 

from TALInterpreter import TALInterpreter

 

thanks
a lot






___
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] Call of TAL interpreter

2005-06-17 Thread Andreas Jung



--On 17. Juni 2005 17:12:19 +0200 Simon ALEXANDRE 
<[EMAIL PROTECTED]> wrote:



Hello



Someone could tell me where I could find in Zope the following call :



from TALInterpreter import TALInterpreter



grep -r "from TALInterpreter import TALInterpreter" *

is your friend.

-aj


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


[Zope] Picking up a parameter in a ZPT

2005-06-17 Thread John Poltorak

I'm trying to work out how to pass parameters between various modules 
running under Zope and have got stuck.

In the line below, I need to replace the word 'links' with a variable 
passed by the calling program


python:here.parse_file(file=context.links,sepr=',',clone=1)"> 

I know I can pass the variable using:-





Just don't know how to reference it under ZPT.



Help!



-- 
John




___
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] Getting information about current method

2005-06-17 Thread Peter Bengtsson
Then, in your External method, try::

 import inspect
 print inspect.stack()[1]


On 6/17/05, Jan-Ole Esleben <[EMAIL PROTECTED]> wrote:
> I want to know the name (and path) of the _External Method_ from
> inside it. What I _can_ get is the name of the DTML method.
> 
> I want to build generic scaffolding code for functions that
> conditionally redispatch as asynchronous calls (via ZASync); that
> part, however, isn't a problem at all - everything works fine as long
> as I use an HTTP request directly and redispatch with information from
> the REQUEST. The problem is that I need a TALES expression to call the
> function again (asynchronously this time), and for that I need the
> ZOPE path to it.
> 
> Ole
> 
> 2005/6/17, Peter Bengtsson <[EMAIL PROTECTED]>:
> > > is there a generic way to find out from Python code which method has
> > > been called (in other words: find out where the current method is
> > > located in the ZOPE hierarchy and what its name is)? If I call an
> > > External Method via a DTML method, of course the REQUEST object
> > > contains the path to the DTML method because the External Method
> > > hasn't been called via HTTP. I haven't been able to figure out any
> > > other way of getting this information.
> > >
> > I don't get it. Do you want to know the name of the DTML method from
> > inside the External method?
> > Perhaps I'll be able to help if you tell us more about the intention
> > of this code.
> >
> > > Thanks in advance,
> > > Ole
> > > ___
> > > 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 )
> 


-- 
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] automagic reindexing of objects

2005-06-17 Thread Peter Bengtsson
On 6/17/05, Jürgen Herrmann <[EMAIL PROTECTED]> wrote:
> 
> [ Peter Bengtsson wrote:]
> > Personally I think one should stay the hell away from transactions.
> > They're not for you to fiddle with.
> > I understand your question and even though I think it's a bit crazy I
> > can see a benefit (simplicity for the programmer).
> >
> > How about a trickery solution like this:
> >
> > class CatalogPathAware:
> > def index_object(self, *a, **k):
> > print self.__class__.__name__, "in for indexing!"
> >
> > class _MyProduct(CatalogPathAware):
> > def __init__(self, id, title=''):
> > self.id = id
> > self.title = title
> > def setTitle(self, title):
> > # could be much more complicated
> > self.title = title
> >
> > class MyProduct(_MyProduct):
> > def setTitle(self, title):
> > _MyProduct.setTitle(self, title)
> > self.index_object()
> >
> > inst = MyProduct("instanceA")
> > inst.setTitle('Peter')
> >
> > print inst.title
> >
> >
> > You would basically rename your existing class from "Whatever" to
> > "_Whatever" and continue as before. This does mean however that you
> > have to explicitly write a function for each setter.
> >
> hmm, i can't see how this would help. if i call index_object in every
> attribute getter method, the indexing is done possibly several times,
> unnecessary and (cpu)time consuming.
> 
Writes happen a lot less often but they also cost a lot more. 
It'd be nice to be able to hotwire the parentless class so that it
magically "wraps" all functions that match on::

 re.compile('set[A-Z]\w+')

It would be hard to find out what the functions are, eg::

class MyProduct(_MyProduct):
def __init__(self, *a, **k):
   _MyProduct.__init__(self, *a, **k)
   for fun in dir(_MyProduct):
   if camel_setters_regex.findall(fun):
   print "create a wrapping method called %s" % fun

How to magically create a method upon itself with an arbitary name is
something I don't know how to do but it's not impossible because I
know that Archetypes (cmf, plone) does it.

> juergen
> ___
> 
> >> XLhost.de - eXperts in Linux hosting <<
> 
> Juergen Herrmann
> Weiherweg 10, 93051 Regensburg, Germany
> Fon:  +49 (0)700 XLHOSTDE [0700 95467833]
> Fax:  +49 (0)721 151 463027
> 
> ICQ:  27139974  -  IRC: [EMAIL PROTECTED]
> WEB:  http://www.XLhost.de
> 


-- 
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] Picking up a parameter in a ZPT

2005-06-17 Thread Peter Bengtsson
Try
python:here.parse_file(file=options['parm'],sepr=',',clone=1)">

On 6/17/05, John Poltorak <[EMAIL PROTECTED]> wrote:
> 
> I'm trying to work out how to pass parameters between various modules
> running under Zope and have got stuck.
> 
> In the line below, I need to replace the word 'links' with a variable
> passed by the calling program
> 
> 
> python:here.parse_file(file=context.links,sepr=',',clone=1)">
> 
> I know I can pass the variable using:-
> 
> 
> 
> 
> 
> Just don't know how to reference it under ZPT.
> 
> 
> 
> Help!
> 
> 
> 
> --
> John
> 
> 
> 
> 
> ___
> 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] Picking up a parameter in a ZPT

2005-06-17 Thread Andreas Jung



--On 17. Juni 2005 16:19:46 +0100 John Poltorak <[EMAIL PROTECTED]> wrote:



I'm trying to work out how to pass parameters between various modules
running under Zope and have got stuck.

In the line below, I need to replace the word 'links' with a variable
passed by the calling program


python:here.parse_file(file=context.links,sepr=',',clone=1)">

I know I can pass the variable using:-





Just don't know how to reference it under ZPT.


In the very same way as in DTML using "python: context.test()". If you can 
read German I suggest to read the FAQs on zope.de otherwise -> Zope Book -> 
Advanced ZPT...


-aj


pgpjnI17LDBJV.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] Getting information about current method

2005-06-17 Thread Jan-Ole Esleben
Unforunately, this just gives me the pythonic path to the method; what
I need for a TALES expression is the ZOPE path - i.e. what I get from
the stack frame is
... E:\zope\Extensions\req.py ...
but what I need is
... http://localhost:8080/ReqTest ...

Ole


2005/6/17, Peter Bengtsson <[EMAIL PROTECTED]>:
> Then, in your External method, try::
> 
>  import inspect
>  print inspect.stack()[1]
> 
> 
> On 6/17/05, Jan-Ole Esleben <[EMAIL PROTECTED]> wrote:
> > I want to know the name (and path) of the _External Method_ from
> > inside it. What I _can_ get is the name of the DTML method.
> >
> > I want to build generic scaffolding code for functions that
> > conditionally redispatch as asynchronous calls (via ZASync); that
> > part, however, isn't a problem at all - everything works fine as long
> > as I use an HTTP request directly and redispatch with information from
> > the REQUEST. The problem is that I need a TALES expression to call the
> > function again (asynchronously this time), and for that I need the
> > ZOPE path to it.
> >
> > Ole
> >
> > 2005/6/17, Peter Bengtsson <[EMAIL PROTECTED]>:
> > > > is there a generic way to find out from Python code which method has
> > > > been called (in other words: find out where the current method is
> > > > located in the ZOPE hierarchy and what its name is)? If I call an
> > > > External Method via a DTML method, of course the REQUEST object
> > > > contains the path to the DTML method because the External Method
> > > > hasn't been called via HTTP. I haven't been able to figure out any
> > > > other way of getting this information.
> > > >
> > > I don't get it. Do you want to know the name of the DTML method from
> > > inside the External method?
> > > Perhaps I'll be able to help if you tell us more about the intention
> > > of this code.
> > >
> > > > Thanks in advance,
> > > > Ole
> > > > ___
> > > > 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 )
> >
> 
> --
> 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] Using Catalog in a stand-alone application

2005-06-17 Thread Noam Raphael
Hello,

I intend to write a free (GPL) application for browsing and searching
a large collection of classic Hebrew texts, such as the bible. I want
to write it in Python, which is a language that I like very much. It
is supposed to be a stand-alone application, which could be
distributed on a CD.

Some semi-special things I want the search to be able to do: It should
be possible to select which books to search. I might want to allow
some specific variations on the typed words, which are common in
Hebrew. Another thing that may be nice is to find multiple results
within one document, since some texts are quite long.

I've found that Zope's ZCatalog is based on Catalog, which is said to
be possible to run without the full Zope. If you are familiar with
ZCatalog, perhaps you can help me a bit, or point me to places where
to find what I need. I ask, first, if it is reasonable to use Catalog
for such a task. I also want to know which parts of Zope are relevant
for what I need. A general overview about how it works would also be
very nice.

Thank you very much,
Noam Raphael
___
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] Getting information about current method

2005-06-17 Thread Jan-Ole Esleben
No, I'm sorry; I only get system paths.

Ole


2005/6/17, Peter Bengtsson <[EMAIL PROTECTED]>:
> On 6/17/05, Jan-Ole Esleben <[EMAIL PROTECTED]> wrote:
> > Unforunately, this just gives me the pythonic path to the method; what
> > I need for a TALES expression is the ZOPE path - i.e. what I get from
> > the stack frame is
> > ... E:\zope\Extensions\req.py ...
> > but what I need is
> > ... http://localhost:8080/ReqTest ...
> >
> 
> Ok, maybe inspect.stack()[1] was the wrong one. Can't remember nor
> test it for you but try any of the others in that list. Eg.
> inspect.stack()[0] or inspect.stack()[2]
> 
> You can maybe find something by going through REQUEST.PARENTS
> 
> 
> > Ole
> >
> >
> > 2005/6/17, Peter Bengtsson <[EMAIL PROTECTED]>:
> > > Then, in your External method, try::
> > >
> > >  import inspect
> > >  print inspect.stack()[1]
> > >
> > >
> > > On 6/17/05, Jan-Ole Esleben <[EMAIL PROTECTED]> wrote:
> > > > I want to know the name (and path) of the _External Method_ from
> > > > inside it. What I _can_ get is the name of the DTML method.
> > > >
> > > > I want to build generic scaffolding code for functions that
> > > > conditionally redispatch as asynchronous calls (via ZASync); that
> > > > part, however, isn't a problem at all - everything works fine as long
> > > > as I use an HTTP request directly and redispatch with information from
> > > > the REQUEST. The problem is that I need a TALES expression to call the
> > > > function again (asynchronously this time), and for that I need the
> > > > ZOPE path to it.
> > > >
> > > > Ole
> > > >
> > > > 2005/6/17, Peter Bengtsson <[EMAIL PROTECTED]>:
> > > > > > is there a generic way to find out from Python code which method has
> > > > > > been called (in other words: find out where the current method is
> > > > > > located in the ZOPE hierarchy and what its name is)? If I call an
> > > > > > External Method via a DTML method, of course the REQUEST object
> > > > > > contains the path to the DTML method because the External Method
> > > > > > hasn't been called via HTTP. I haven't been able to figure out any
> > > > > > other way of getting this information.
> > > > > >
> > > > > I don't get it. Do you want to know the name of the DTML method from
> > > > > inside the External method?
> > > > > Perhaps I'll be able to help if you tell us more about the intention
> > > > > of this code.
> > > > >
> > > > > > Thanks in advance,
> > > > > > Ole
> > > > > > ___
> > > > > > 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 )
> > > >
> > >
> > > --
> > > 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 )
> >
> 
> --
> 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] Using Catalog in a stand-alone application

2005-06-17 Thread Jonathan
- Original Message - 
From: "Noam Raphael" <[EMAIL PROTECTED]>

I intend to write a free (GPL) application for browsing and searching
a large collection of classic Hebrew texts, such as the bible. I want
to write it in Python, which is a language that I like very much. It
is supposed to be a stand-alone application, which could be
distributed on a CD.

Some semi-special things I want the search to be able to do: It should
be possible to select which books to search. I might want to allow
some specific variations on the typed words, which are common in
Hebrew. Another thing that may be nice is to find multiple results
within one document, since some texts are quite long.

I've found that Zope's ZCatalog is based on Catalog, which is said to
be possible to run without the full Zope. If you are familiar with
ZCatalog, perhaps you can help me a bit, or point me to places where
to find what I need. I ask, first, if it is reasonable to use Catalog
for such a task. I also want to know which parts of Zope are relevant
for what I need. A general overview about how it works would also be
very nice.


Here are some code chunks that may get you going in the right direction:

#!/apps/zope/bin/python
sys.path.append("/apps/zope/lib/python")# change this to work in your 
environment

import Zope
app=Zope.app()
from Testing import makerequest
app = makerequest.makerequest(app)

REQUEST = app.REQUEST

newobj = app.sw.WebSitesFolder.WebSitesData.manage_addProduct 
['SWV2'].WebSites.createInObjectManager(REQUEST['id'], REQUEST)


app.sw.WebSitesFolder.Catalog.catalog_object(newobj, recid)


This was taken from a stand-alone python routine which we use to bulk update 
a ZCatalog (data read in from files on the filesystem).  Zope is not running 
when we execute this routine.


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] automagic reindexing of objects

2005-06-17 Thread Paul Winkler
On Fri, Jun 17, 2005 at 02:19:26PM +0200, J?rgen Herrmann wrote:
> hi all!
> 
> i make heavy use of indexes in my extension classes. these all inherit
> from catalogpathaware, so i have to call object.reindex_object() on
> each changed instance. calling it from attribute getters/setters f.ex.
> is not a good idea, because changing 3 attributes will reindex the object
> 3 times.
> 
> what i'd like to have is that such objects are reindexed automatically
> before comitting a transaction.
> 
> is it possible? where should i start looking in the source, is there
> possibly a before_transaction_commit hook?

I vaguely recall a similar discussion on zodb-dev; a search of the 
archives of that list may be a good idea.

You might also find QueueCatalog useful. AFAICT, if you are
using QueueCatalog and an object asks to be reindexed three times
before the next time the queue is processed, the QueueCatalog will
only actually reindex the object once. The tradeoff is that the
catalog results can be stale. 

It's only available via CVS, and doesn't come with docs, but
the embedded docstrings look pretty good. Note, I haven't used
it yet myself.
http://cvs.zope.org/Products/QueueCatalog/
Or to get a tarball,
http://cvs.zope.org/Products/QueueCatalog/QueueCatalog.tar.gz?tarball=1


It looks like you need some external process to actually 
trigger the processing of the queue.  A cron job calling a wget script
would do the job, or (better imho because it runs as a separate process)
if you are using zeo you could run a pretty trivial python script 
via bin/zopectl ... something like (untested):

import time
while 1:
time.sleep(30)
events_count = app.path.to.my.queuecatalog.process(max=1000)
print "processed %d events" % events_count  # or log it somewhere.

Hope that helps, 
-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] Getting information about current method

2005-06-17 Thread Peter Bengtsson
On 6/17/05, Jan-Ole Esleben <[EMAIL PROTECTED]> wrote:
> No, I'm sorry; I only get system paths.
> 
And what about REQUEST.PARENTS? (or is that just the http request)



> Ole
> 
> 
> 2005/6/17, Peter Bengtsson <[EMAIL PROTECTED]>:
> > On 6/17/05, Jan-Ole Esleben <[EMAIL PROTECTED]> wrote:
> > > Unforunately, this just gives me the pythonic path to the method; what
> > > I need for a TALES expression is the ZOPE path - i.e. what I get from
> > > the stack frame is
> > > ... E:\zope\Extensions\req.py ...
> > > but what I need is
> > > ... http://localhost:8080/ReqTest ...
> > >
> >
> > Ok, maybe inspect.stack()[1] was the wrong one. Can't remember nor
> > test it for you but try any of the others in that list. Eg.
> > inspect.stack()[0] or inspect.stack()[2]
> >
> > You can maybe find something by going through REQUEST.PARENTS
> >
> >
> > > Ole
> > >
> > >
> > > 2005/6/17, Peter Bengtsson <[EMAIL PROTECTED]>:
> > > > Then, in your External method, try::
> > > >
> > > >  import inspect
> > > >  print inspect.stack()[1]
> > > >
> > > >
> > > > On 6/17/05, Jan-Ole Esleben <[EMAIL PROTECTED]> wrote:
> > > > > I want to know the name (and path) of the _External Method_ from
> > > > > inside it. What I _can_ get is the name of the DTML method.
> > > > >
> > > > > I want to build generic scaffolding code for functions that
> > > > > conditionally redispatch as asynchronous calls (via ZASync); that
> > > > > part, however, isn't a problem at all - everything works fine as long
> > > > > as I use an HTTP request directly and redispatch with information from
> > > > > the REQUEST. The problem is that I need a TALES expression to call the
> > > > > function again (asynchronously this time), and for that I need the
> > > > > ZOPE path to it.
> > > > >
> > > > > Ole
> > > > >
> > > > > 2005/6/17, Peter Bengtsson <[EMAIL PROTECTED]>:
> > > > > > > is there a generic way to find out from Python code which method 
> > > > > > > has
> > > > > > > been called (in other words: find out where the current method is
> > > > > > > located in the ZOPE hierarchy and what its name is)? If I call an
> > > > > > > External Method via a DTML method, of course the REQUEST object
> > > > > > > contains the path to the DTML method because the External Method
> > > > > > > hasn't been called via HTTP. I haven't been able to figure out any
> > > > > > > other way of getting this information.
> > > > > > >
> > > > > > I don't get it. Do you want to know the name of the DTML method from
> > > > > > inside the External method?
> > > > > > Perhaps I'll be able to help if you tell us more about the intention
> > > > > > of this code.
> > > > > >
> > > > > > > Thanks in advance,
> > > > > > > Ole
> > > > > > > ___
> > > > > > > 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 )
> > > > >
> > > >
> > > > --
> > > > 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 )
> > >
> >
> > --
> > 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 )
> 


-- 
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] Getting information about current method

2005-06-17 Thread Jan-Ole Esleben
It's an application instance wrapped in a list; it seems to be
identical to self, actually - self.REQUEST['URL'] and
self.REQUEST.PARENTS[0].REQUEST['URL'] are the same. However, the two
REQUESTs are not the identical object (== returns False).

Ole


2005/6/17, Peter Bengtsson <[EMAIL PROTECTED]>:
> On 6/17/05, Jan-Ole Esleben <[EMAIL PROTECTED]> wrote:
> > No, I'm sorry; I only get system paths.
> >
> And what about REQUEST.PARENTS? (or is that just the http request)
> 
> 
> > Ole
> >
> >
> > 2005/6/17, Peter Bengtsson <[EMAIL PROTECTED]>:
> > > On 6/17/05, Jan-Ole Esleben <[EMAIL PROTECTED]> wrote:
> > > > Unforunately, this just gives me the pythonic path to the method; what
> > > > I need for a TALES expression is the ZOPE path - i.e. what I get from
> > > > the stack frame is
> > > > ... E:\zope\Extensions\req.py ...
> > > > but what I need is
> > > > ... http://localhost:8080/ReqTest ...
> > > >
> > >
> > > Ok, maybe inspect.stack()[1] was the wrong one. Can't remember nor
> > > test it for you but try any of the others in that list. Eg.
> > > inspect.stack()[0] or inspect.stack()[2]
> > >
> > > You can maybe find something by going through REQUEST.PARENTS
> > >
> > >
> > > > Ole
> > > >
> > > >
> > > > 2005/6/17, Peter Bengtsson <[EMAIL PROTECTED]>:
> > > > > Then, in your External method, try::
> > > > >
> > > > >  import inspect
> > > > >  print inspect.stack()[1]
> > > > >
> > > > >
> > > > > On 6/17/05, Jan-Ole Esleben <[EMAIL PROTECTED]> wrote:
> > > > > > I want to know the name (and path) of the _External Method_ from
> > > > > > inside it. What I _can_ get is the name of the DTML method.
> > > > > >
> > > > > > I want to build generic scaffolding code for functions that
> > > > > > conditionally redispatch as asynchronous calls (via ZASync); that
> > > > > > part, however, isn't a problem at all - everything works fine as 
> > > > > > long
> > > > > > as I use an HTTP request directly and redispatch with information 
> > > > > > from
> > > > > > the REQUEST. The problem is that I need a TALES expression to call 
> > > > > > the
> > > > > > function again (asynchronously this time), and for that I need the
> > > > > > ZOPE path to it.
> > > > > >
> > > > > > Ole
> > > > > >
> > > > > > 2005/6/17, Peter Bengtsson <[EMAIL PROTECTED]>:
> > > > > > > > is there a generic way to find out from Python code which 
> > > > > > > > method has
> > > > > > > > been called (in other words: find out where the current method 
> > > > > > > > is
> > > > > > > > located in the ZOPE hierarchy and what its name is)? If I call 
> > > > > > > > an
> > > > > > > > External Method via a DTML method, of course the REQUEST object
> > > > > > > > contains the path to the DTML method because the External Method
> > > > > > > > hasn't been called via HTTP. I haven't been able to figure out 
> > > > > > > > any
> > > > > > > > other way of getting this information.
> > > > > > > >
> > > > > > > I don't get it. Do you want to know the name of the DTML method 
> > > > > > > from
> > > > > > > inside the External method?
> > > > > > > Perhaps I'll be able to help if you tell us more about the 
> > > > > > > intention
> > > > > > > of this code.
> > > > > > >
> > > > > > > > Thanks in advance,
> > > > > > > > Ole
> > > > > > > > ___
> > > > > > > > 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 )
> > > > > >
> > > > >
> > > > > --
> > > > > 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 )
> > > >
> > >
> > > --
> > > Peter Bengtsson,
> > > work www.fry-it.com
> > > home www.peterbe.com
> > > hobby www.issuetrackerproduct.com
> > >
> > ___
> > Zope maillist  -  Zope@zope.org
> > http://mail.zo

Re: [Zope] Getting information about current method

2005-06-17 Thread Peter Bengtsson
On 6/17/05, Jan-Ole Esleben <[EMAIL PROTECTED]> wrote:
> It's an application instance wrapped in a list; it seems to be
> identical to self, actually - self.REQUEST['URL'] and
> self.REQUEST.PARENTS[0].REQUEST['URL'] are the same. However, the two
> REQUESTs are not the identical object (== returns False).
> 

Then I don't know. 
(The application instance is none other than zope itself. )
I can honestly not think of a way to extract this information. I've
even tried setting up a simple example method and I couldn't get hold
of the zodb name of the external method that is called.

Perhaps Andreas or Dieter can help us here??


> Ole
> 
> 
> 2005/6/17, Peter Bengtsson <[EMAIL PROTECTED]>:
> > On 6/17/05, Jan-Ole Esleben <[EMAIL PROTECTED]> wrote:
> > > No, I'm sorry; I only get system paths.
> > >
> > And what about REQUEST.PARENTS? (or is that just the http request)
> >
> >
> > > Ole
> > >
> > >
> > > 2005/6/17, Peter Bengtsson <[EMAIL PROTECTED]>:
> > > > On 6/17/05, Jan-Ole Esleben <[EMAIL PROTECTED]> wrote:
> > > > > Unforunately, this just gives me the pythonic path to the method; what
> > > > > I need for a TALES expression is the ZOPE path - i.e. what I get from
> > > > > the stack frame is
> > > > > ... E:\zope\Extensions\req.py ...
> > > > > but what I need is
> > > > > ... http://localhost:8080/ReqTest ...
> > > > >
> > > >
> > > > Ok, maybe inspect.stack()[1] was the wrong one. Can't remember nor
> > > > test it for you but try any of the others in that list. Eg.
> > > > inspect.stack()[0] or inspect.stack()[2]
> > > >
> > > > You can maybe find something by going through REQUEST.PARENTS
> > > >
> > > >
> > > > > Ole
> > > > >
> > > > >
> > > > > 2005/6/17, Peter Bengtsson <[EMAIL PROTECTED]>:
> > > > > > Then, in your External method, try::
> > > > > >
> > > > > >  import inspect
> > > > > >  print inspect.stack()[1]
> > > > > >
> > > > > >
> > > > > > On 6/17/05, Jan-Ole Esleben <[EMAIL PROTECTED]> wrote:
> > > > > > > I want to know the name (and path) of the _External Method_ from
> > > > > > > inside it. What I _can_ get is the name of the DTML method.
> > > > > > >
> > > > > > > I want to build generic scaffolding code for functions that
> > > > > > > conditionally redispatch as asynchronous calls (via ZASync); that
> > > > > > > part, however, isn't a problem at all - everything works fine as 
> > > > > > > long
> > > > > > > as I use an HTTP request directly and redispatch with information 
> > > > > > > from
> > > > > > > the REQUEST. The problem is that I need a TALES expression to 
> > > > > > > call the
> > > > > > > function again (asynchronously this time), and for that I need the
> > > > > > > ZOPE path to it.
> > > > > > >
> > > > > > > Ole
> > > > > > >
> > > > > > > 2005/6/17, Peter Bengtsson <[EMAIL PROTECTED]>:
> > > > > > > > > is there a generic way to find out from Python code which 
> > > > > > > > > method has
> > > > > > > > > been called (in other words: find out where the current 
> > > > > > > > > method is
> > > > > > > > > located in the ZOPE hierarchy and what its name is)? If I 
> > > > > > > > > call an
> > > > > > > > > External Method via a DTML method, of course the REQUEST 
> > > > > > > > > object
> > > > > > > > > contains the path to the DTML method because the External 
> > > > > > > > > Method
> > > > > > > > > hasn't been called via HTTP. I haven't been able to figure 
> > > > > > > > > out any
> > > > > > > > > other way of getting this information.
> > > > > > > > >
> > > > > > > > I don't get it. Do you want to know the name of the DTML method 
> > > > > > > > from
> > > > > > > > inside the External method?
> > > > > > > > Perhaps I'll be able to help if you tell us more about the 
> > > > > > > > intention
> > > > > > > > of this code.
> > > > > > > >
> > > > > > > > > Thanks in advance,
> > > > > > > > > Ole
> > > > > > > > > ___
> > > > > > > > > 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 )
> > > > > > >
> > > > > >
> > > > > > --
> > > > > > Peter Bengtsson,
> > > > > > work www.fry-it.com
> > > > > > home www.peterbe.com
> > > > 

Re: [Zope] Python Scripts

2005-06-17 Thread Dieter Maurer
Dennis Allison wrote at 2005-6-16 09:06 -0700:
>We have been seeing a number of instances where python scripts fail due to 
>an apparent "syntax error" but the syntax is correct and simply storing 
>the method restores it to functionality.   Anyone else seeing this?

I saw this today.

I expect DOS type line endings.

Your browser (or maybe the ":text" converter in ZPublisher) will remove
them. Therefore, they disappear when you "store" again.

-- 
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] IE v. Firefox for viewing Zope sites

2005-06-17 Thread Dieter Maurer
John Poltorak wrote at 2005-6-16 22:33 +0100:
> ...
>I was advised to change 
>
> 
>
>to 
>
>http://www.mysite.org/"; /> 
>
>and that seemed to sort out most of the problems.

You should not fiddle with the "base" tag (unless you precisely (!)
know what you are doing). Zope sets it automatically when
it is necessary (and you did not provide your own one).

>Do I really need to hard code the site name like this, or is there some 
>variable I can use?

Do not do it at all!

You cannot expect something better, do you?


-- 
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] automagic reindexing of objects

2005-06-17 Thread Dieter Maurer
Jürgen Herrmann wrote at 2005-6-17 14:19 +0200:
>i make heavy use of indexes in my extension classes. these all inherit
>from catalogpathaware, so i have to call object.reindex_object() on
>each changed instance. calling it from attribute getters/setters f.ex.
>is not a good idea, because changing 3 attributes will reindex the object
>3 times.
>
>what i'd like to have is that such objects are reindexed automatically
>before comitting a transaction.
>
>is it possible? where should i start looking in the source, is there
>possibly a before_transaction_commit hook?

It is impossible with "ZODB 3.2" (unless you patch
"ZODB.Transaction.Transaction").

"ZODB 3.4" (which is used for Zope 2.8/3.1) has hooks
that makes it possible.

-- 
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] Passing parameters using DTML

2005-06-17 Thread Dieter Maurer
Tino Wildenhain wrote at 2005-6-17 10:57 +0200:
> ...
>Not at all. You could either have tried
>it out ;) Or looked at the DTML documentation
>in the Zope book *wink* ;)
>
>

Be warned: this is likely to cause loss of the namespace.
Do not forget to pass the two positional arguments (usually
as "None, _"). They are essential.

For more details, read "Calling DTML Objects" of

  


-- 
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] Passing parameters using DTML

2005-06-17 Thread Tino Wildenhain
Am Freitag, den 17.06.2005, 19:09 +0200 schrieb Dieter Maurer:
> Tino Wildenhain wrote at 2005-6-17 10:57 +0200:
> > ...
> >Not at all. You could either have tried
> >it out ;) Or looked at the DTML documentation
> >in the Zope book *wink* ;)
> >
> >
> 
> Be warned: this is likely to cause loss of the namespace.
> Do not forget to pass the two positional arguments (usually
> as "None, _"). They are essential.
> 
> For more details, read "Calling DTML Objects" of
> 
>   
> 
Thanks Dieter, I must confess I was just too lazy to show
all the pitfalls, assuming John takes the hint and reads
the docs again *wink* ;)

___
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] Blank page problem

2005-06-17 Thread Mike

Hello All,

	I'm currently running an intranet site using Zope and Plone and our users  
have been experiencing a very large number of blank pages (view source  
shows the html, head, and body tag, but that's it) on our site.  From what  
I can tell, nothing relevent is appearing in the logs and all my attempts  
to catch them or atleast acknowledge that they happened show nothing. The  
blank pages are also immediate and are not consistent whatsoever. I've  
tried googling the problem, and have found a few threads that appear to be  
the same issue, but they've either gone unanswered or didn't have a solid  
solution.


	The product that by far creates the most blank pages for us is a custom  
one that executes code on our main server, and on average takes on average  
about 1 second, but can take up to a minute (rare) for a response.  We  
currently use SOAP for this, but had the same problem when we were using  
ssh and rsh.


	We have about 800 users that have access to the system, and maybe 20-100  
people on at any given time.  The server is a dual 1.3gig machine running  
Mandrake Linux version 2.4.25 with 512MB of ram.  We're completely at a  
loss on what to try to alleviate this problem, and are greatful for any  
help or insight anyone has to give.


Thanks,
Mike Patterson
___
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] Passing parameters using DTML

2005-06-17 Thread John Poltorak
On Fri, Jun 17, 2005 at 07:09:04PM +0200, Dieter Maurer wrote:
> Tino Wildenhain wrote at 2005-6-17 10:57 +0200:
> > ...
> >Not at all. You could either have tried
> >it out ;) Or looked at the DTML documentation
> >in the Zope book *wink* ;)
> >
> >
> 
> Be warned: this is likely to cause loss of the namespace.
> Do not forget to pass the two positional arguments (usually
> as "None, _"). They are essential.
> 
> For more details, read "Calling DTML Objects" of
> 
>   


That looks useful.

Is there also something which explains how to call ZPTs from a DTML 
object?

I'm unable to pick up a passed parameter.

This is what I've conjured up:-

python:here.lib.parse_file(file=context.options['parm'],sepr=',',clone=1)"> 

hoping that "options['parm']" would get resolved as "ABC" but it doesn't.

Any ideas? 


> 
> -- 
> Dieter


-- 
John


___
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] Passing parameters using DTML

2005-06-17 Thread Andreas Jung



--On 17. Juni 2005 20:24:23 +0100 John Poltorak <[EMAIL PROTECTED]> wrote:

Is there also something which explains how to call ZPTs from a DTML
object?



Do you have a good reason for mixing ZPT and DTML?

-aj





pgphTjDYprDSb.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] Passing parameters using DTML

2005-06-17 Thread John Poltorak
On Fri, Jun 17, 2005 at 09:31:44PM +0200, Andreas Jung wrote:
> 
> 
> --On 17. Juni 2005 20:24:23 +0100 John Poltorak <[EMAIL PROTECTED]> wrote:
> > Is there also something which explains how to call ZPTs from a DTML
> > object?
> >
> 
> Do you have a good reason for mixing ZPT and DTML?

Yes.

I have a routine which works, but currently is uses a hard coded object 
names so I need to have lots of similar objects. I'm just trying to create 
something generic to simplify things.

It's taken me several weeks to get this far and I don't feel like 
scrapping everything and spending a few months learning something entirely 
different which only gurus can handle.
 
> -aj
> 
> 
> 


-- 
John



___
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] Passing parameters using DTML

2005-06-17 Thread Andreas Jung



--On 17. Juni 2005 20:40:14 +0100 John Poltorak <[EMAIL PROTECTED]> wrote:


spending a few months learning something
entirely  different which only gurus can handle.


This refers to what?

-aj


pgpRdMhEJ5aC2.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] Picking up a parameter in a ZPT

2005-06-17 Thread Peter Bengtsson
On 6/17/05, John Poltorak <[EMAIL PROTECTED]> wrote:
> On Fri, Jun 17, 2005 at 04:33:28PM +0100, Peter Bengtsson wrote:
> > Try
> > python:here.parse_file(file=options['parm'],sepr=',',clone=1)">
> 
> Thanks for the suggestion, but I need to get the 'context' keyword in
> there.
> 

No. "context" is different from "options". context is the Zope
namespace and options is a namespace that holds which parameters the
template was called with.

> I tried this
> 
> python:here.parse_file(file=context.options['parm'],sepr=',',clone=1)">
> 
> but ended up with
> 
> Error Type: AttributeError
> Error Value: options
> 
> Don't seem to be able to get the right syntax...
> 
> John
> 
> > On 6/17/05, John Poltorak <[EMAIL PROTECTED]> wrote:
> > >
> > > I'm trying to work out how to pass parameters between various modules
> > > running under Zope and have got stuck.
> > >
> > > In the line below, I need to replace the word 'links' with a variable
> > > passed by the calling program
> > >
> > >
> > > python:here.parse_file(file=context.links,sepr=',',clone=1)">
> > >
> > > I know I can pass the variable using:-
> > >
> > >
> > > 
> > >
> > >
> > > Just don't know how to reference it under ZPT.
> > >
> > >
> > >
> > > Help!
> > >
> > >
> > >
> > > --
> > > John
> >
> > --
> > Peter Bengtsson,
> > work www.fry-it.com
> > home www.peterbe.com
> > hobby www.issuetrackerproduct.com
> 
> 
> 


-- 
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] Passing parameters using DTML

2005-06-17 Thread J Cameron Cooper



John Poltorak wrote:


On Fri, Jun 17, 2005 at 07:09:04PM +0200, Dieter Maurer wrote:


Tino Wildenhain wrote at 2005-6-17 10:57 +0200:


...
Not at all. You could either have tried
it out ;) Or looked at the DTML documentation
in the Zope book *wink* ;)





Be warned: this is likely to cause loss of the namespace.
Do not forget to pass the two positional arguments (usually
as "None, _"). They are essential.

For more details, read "Calling DTML Objects" of

 



That looks useful.

Is there also something which explains how to call ZPTs from a DTML 
object?


I'm unable to pick up a passed parameter.

This is what I've conjured up:-

python:here.lib.parse_file(file=context.options['parm'],sepr=',',clone=1)"> 

hoping that "options['parm']" would get resolved as "ABC" but it 
doesn't.


Any ideas? 



When you call a ZPT like::

 context.somePT(dog="beagle")

you can get to it in the template like::

 options/dog

or::

 python:options.dog

or::

 python:getattr(options,'dog')

or maybe even::

 python:options['dog']

Note that in the last two, I didn't need to know the name of the 
parameter at coding time, but could find it at runtime. If I have::


 tal:define="att string:dog"

then I can do::

 python:getattr(options,att)

The 'options' name is not contained in context. It is it's own 
first-class namespace.


If 'parse_file' above is a ZPT, you can ask for options/file, 
options/sepr, and options/clone.


   --jcc

--
"Building Websites with Plone"
http://plonebook.packtpub.com/

Enfold Systems, LLC
http://www.enfoldsystems.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] Passing parameters using DTML

2005-06-17 Thread Paul Winkler
On Fri, Jun 17, 2005 at 08:24:23PM +0100, John Poltorak wrote:
> Is there also something which explains how to call ZPTs from a DTML 
> object?
>
> I'm unable to pick up a passed parameter.
> 
> This is what I've conjured up:-
> 
> python:here.lib.parse_file(file=context.options['parm'],sepr=',',clone=1)"> 
> 
> hoping that "options['parm']" would get resolved as "ABC" but it doesn't.

John, please, *always* provide tracebacks instead of saying things
like "it doesn't".  

> Any ideas? 

Without a traceback, everything I say below is guesswork.
 
I'm assuming the above line comes from a page template.
You neglected to mention what the calling DTML looks like,
but I *guess* that it was something like this:

yes? no?

I am pretty sure that your problem is with the expression
context.options['parm'].  Why do I say this?
Hint 1: Look at that expression from left to right.
Hint 2: Think about what "context.options" means.

In general, if you have not, you really should read the whole of 
http://www.plope.com/Books/2_7Edition/BasicScripting.stx
and  http://www.plope.com/Books/2_7Edition/ScriptingZope.stx
... not just once but several times :-)

Taken together, they answer all "how to call X from Y" questions.

-- 

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] Passing parameters using DTML

2005-06-17 Thread John Poltorak
On Fri, Jun 17, 2005 at 05:07:32PM -0400, Paul Winkler wrote:
> On Fri, Jun 17, 2005 at 08:24:23PM +0100, John Poltorak wrote:
> > Is there also something which explains how to call ZPTs from a DTML 
> > object?
> >
> > I'm unable to pick up a passed parameter.
> > 
> > This is what I've conjured up:-
> > 
> > python:here.lib.parse_file(file=context.options['parm'],sepr=',',clone=1)"> 
> > 
> > hoping that "options['parm']" would get resolved as "ABC" but it doesn't.
> 
> John, please, *always* provide tracebacks instead of saying things
> like "it doesn't".  
> 
> > Any ideas? 
> 
> Without a traceback, everything I say below is guesswork.
>  
> I'm assuming the above line comes from a page template.
> You neglected to mention what the calling DTML looks like,
> but I *guess* that it was something like this:
> 
> yes? no?

This is what I have:-



I wish to get 'myobjectname' into this line in 'testlist' which is marked
with *

python:here.parse_file(file=context.**,sepr=',',clone=1)"> 

There must be a simple way of doing this, but I haven't come across an 
example of it and I've spent most of the day on it.
 
> I am pretty sure that your problem is with the expression
> context.options['parm'].  Why do I say this?
> Hint 1: Look at that expression from left to right.
> Hint 2: Think about what "context.options" means.
> 
> In general, if you have not, you really should read the whole of 
> http://www.plope.com/Books/2_7Edition/BasicScripting.stx
> and  http://www.plope.com/Books/2_7Edition/ScriptingZope.stx
> ... not just once but several times :-)

There is too much to read and understand. Much of it only ever makes any 
sense in retrospect. Manuals are not a very useful way of learning how to 
do something

 
> Taken together, they answer all "how to call X from Y" questions.

I'm sure they do, if you can make any sense of it. 
 
> -- 
> 
> Paul Winkler
> http://www.slinkp.com


-- 
John


___
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] Passing parameters using DTML

2005-06-17 Thread J Cameron Cooper

John Poltorak wrote:

On Fri, Jun 17, 2005 at 05:07:32PM -0400, Paul Winkler wrote:


On Fri, Jun 17, 2005 at 08:24:23PM +0100, John Poltorak wrote:

Is there also something which explains how to call ZPTs from a DTML 
object?


I'm unable to pick up a passed parameter.

This is what I've conjured up:-

python:here.lib.parse_file(file=context.options['parm'],sepr=',',clone=1)"> 


hoping that "options['parm']" would get resolved as "ABC" but it doesn't.


John, please, *always* provide tracebacks instead of saying things
like "it doesn't".  



Any ideas? 


Without a traceback, everything I say below is guesswork.

I'm assuming the above line comes from a page template.
You neglected to mention what the calling DTML looks like,
but I *guess* that it was something like this:

yes? no?



This is what I have:-



I wish to get 'myobjectname' into this line in 'testlist' which is marked
with *

python:here.parse_file(file=context.**,sepr=',',clone=1)"> 

There must be a simple way of doing this, but I haven't come across an 
example of it and I've spent most of the day on it.


Taking the options from my previous email and putting them together, you 
can say::


   python:here.parse_file(file=getattr(context,options.parm),...)

to get the attribute on the current context named 'myobjectname' or 
whatever else you provide as the 'parm' parameter on 'testlist'.


The ellipsis is just to eliminate elements unnecessary to the point.

--jcc

--
"Building Websites with Plone"
http://plonebook.packtpub.com/

Enfold Systems, LLC
http://www.enfoldsystems.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] Passing parameters using DTML

2005-06-17 Thread Paul Winkler
On Fri, Jun 17, 2005 at 11:25:30PM +0100, John Poltorak wrote:
> This is what I have:-
> 
> 
> 
> I wish to get 'myobjectname' into this line in 'testlist' which is marked
> with *
> 
> python:here.parse_file(file=context.**,sepr=',',clone=1)"> 
>
 
> There must be a simple way of doing this, but I haven't come across an 
> example of it and I've spent most of the day on it.

OK, I repeat my earlier suggestion:
  
> > Hint 1: Look at that expression from left to right.
> > Hint 2: Think about what "context.options" means.

Here's another clue: 
You are not really having a DTML problem. 
You are not really having a ZPT problem.
You are not even really having a Zope problem.
You are having a python problem.

The problem is:  given an object, foo, and an arbitrary string that 
identifies an attribute of foo, how do you get at that attribute?

There is a built-in python function that exists for exactly
this purpose.  Read about the getattr() function here:
http://python.org/doc/2.3.5/lib/built-in-funcs.html

> > In general, if you have not, you really should read the whole of 
> > http://www.plope.com/Books/2_7Edition/BasicScripting.stx
> > and  http://www.plope.com/Books/2_7Edition/ScriptingZope.stx
> > ... not just once but several times :-)
> 
> There is too much to read and understand. Much of it only ever makes any 
> sense in retrospect. Manuals are not a very useful way of learning how to 
> do something

(resists urge to rant)

Look - it doesn't have to all make sense on the first read, but
eventually it starts to click. If you won't even read it at all, you're
screwed before you begin.
 
-- 

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 )