RE: [Zope] PropertyIds

2000-06-19 Thread Oleg Broytmann

On Mon, 19 Jun 2000, RC Compaan wrote:
>  returns a list of key-value pairs
> [('Key1','Value1'},('Key2','Value2')]
> 
> to access the values of each key sequentially i tried:
> 

   When running over a list of pairs, dmtl-in automatically splits pairs
into sequence-key and sequence-item

Oleg.(All opinions are mine and not of my employer)
 
Oleg Broytmann  Foundation for Effective Policies  [EMAIL PROTECTED]
   Programmers don't die, they just GOSUB without RETURN.


___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




RE: [Zope] PropertyIds

2000-06-19 Thread RC Compaan

Very clear, thanks.  Really appreciated.

Well i guess the topic was never about propertyids, but i can only tell that
now.  Still working with properties i find the following trouble.

 returns a list of key-value pairs
[('Key1','Value1'},('Key2','Value2')]

to access the values of each key sequentially i tried:

  
  :


But this just returns "k" and "ey" resulting in a slice of the keyname.

Roché

> Thanks Rik it works.
>
> I've noticed in some cases that one puts empty brackets at the end of
> certain zope object methods.  Is that there for methods that can take
> parameters?
>
>
> [rh]Um, not quite, it has to do with the way of calling the object methods
> in question. DTML has two ways of calling: by name and through
> expressions.
>
> 1. The 'normal' Zope way of writing things is  objectValues>. This
> is shorthand for .
>
> 2. The other way is . This is shorthand for
> . Everything inside the expression
> is treated
> as a python expression. If you call it without the brackets, you're just
> referencing the method. If you try that in a DTML Method and look in the
> source of the diplayed document you'll see something like
> . If you want to _call_ the
> method, you'll
> have to add the brackets (with or without arguments).
>
> Hope this is clear.
>
>
>
> Rik
>


___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




Re: [Zope] PropertyIds

2000-06-19 Thread Rik Hoekstra




Thanks Rik it works.

I've noticed in some cases that one puts empty brackets at the end of
certain zope object methods.  Is that there for methods that can take
parameters?


[rh]Um, not quite, it has to do with the way of calling the object methods
in question. DTML has two ways of calling: by name and through expressions.

1. The 'normal' Zope way of writing things is . This
is shorthand for .

2. The other way is . This is shorthand for
. Everything inside the expression is treated
as a python expression. If you call it without the brackets, you're just
referencing the method. If you try that in a DTML Method and look in the
source of the diplayed document you'll see something like
. If you want to _call_ the method, you'll
have to add the brackets (with or without arguments).

Hope this is clear.



Rik


___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




RE: [Zope] PropertyIds

2000-06-19 Thread RC Compaan

Thanks Rik it works.

I've noticed in some cases that one puts empty brackets at the end of
certain zope object methods.  Is that there for methods that can take
parameters?

Roché

> -Original Message-
> From: Rik Hoekstra [mailto:[EMAIL PROTECTED]]
> Sent: 19 June 2000 12:54
> To: RC Compaan
> Cc: Zope
> Subject: Re: [Zope] PropertyIds
>
>
>
>
> >
> > I have a very simple documentclass in very simple structure in
> method that
> > should return the properties of the document:
> >
> > 
> >   // RESULTS is a ZClass Object Manager
> > // tmp is a
> > document with an id equal to the cookie
> >   
>
> this line should read:
>
> 
>
> Two things going wrong:
>
> 1. the dtml-return tag is for DTML Methods that should just return
> something. You want dtml-var.
> 2. you call propertyIds in an expression (the line is shorthand for
>  - in that case you have to call it
> as a function.
>
> > 
> >
> > During the application i add properties to the document and
> want to display
> > them with the above method.  The Property ids does not get shown though.
> > I've tried:
> >   
> > 
> >   
>
> this should get you a list, like ['title', 'prop1, ...]
>
>
> > and also:
> >   
> > 
> >   
>
> this doesn't work for reasons outlined above.
>
>
> Rik
>


___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




Re: [Zope] PropertyIds

2000-06-19 Thread Rik Hoekstra



> 
> I have a very simple documentclass in very simple structure in method that
> should return the properties of the document:
> 
> 
>   // RESULTS is a ZClass Object Manager
> // tmp is a
> document with an id equal to the cookie
>   

this line should read:



Two things going wrong:

1. the dtml-return tag is for DTML Methods that should just return
something. You want dtml-var.
2. you call propertyIds in an expression (the line is shorthand for 
 - in that case you have to call it
as a function. 

> 
> 
> During the application i add properties to the document and want to display
> them with the above method.  The Property ids does not get shown though.
> I've tried:
>   
> 
>   

this should get you a list, like ['title', 'prop1, ...]


> and also:
>   
> 
>   

this doesn't work for reasons outlined above.


Rik

___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




Re: [Zope] PropertyIds

2000-06-19 Thread Oleg Broytmann

On Mon, 19 Jun 2000, RC Compaan wrote:
> // tmp is a
> document with an id equal to the cookie

1. Isn't it enough just to write _.getitem(tid)?

2. A shot in the dark: tmp is not a document, but its rendering. Try
getitem(tid, 0)...

Oleg.(All opinions are mine and not of my employer)
 
Oleg Broytmann  Foundation for Effective Policies  [EMAIL PROTECTED]
   Programmers don't die, they just GOSUB without RETURN.


___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




[Zope] PropertyIds

2000-06-19 Thread RC Compaan

I have a very simple documentclass in very simple structure in method that
should return the properties of the document:


  // RESULTS is a ZClass Object Manager
// tmp is a
document with an id equal to the cookie
  


During the application i add properties to the document and want to display
them with the above method.  The Property ids does not get shown though.
I've tried:
  

  
and also:
  

  
But no luck.
How can this work?

Roché


___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )