[Zope] Problems with sequence-item

2000-10-22 Thread Taco Scargo

I get errors when sequence-item is being called to list the contents of a
folder

E.g.
dtml-in "(1,2,3)" reverse
dtml-var sequence-item
/dtml-in

correctly outputs 3 2 1

When I do

dtml-in "folder.objectValues()"
dtml-var id
/dtml-in

it correctly outputs all ids in the folder.

But

dtml-in "folder.objectValues()"
dtml-var sequence-item
/dtml-in

will fail with an error
Error Type: AttributeError
Error Value: __call__

What am I doing wrong ?

Thanks,

Taco Scargo





   1stUp.com - Free the Web
   Get your free Internet access at http://www.1stUp.com

___
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] Problems with sequence-item

2000-10-22 Thread Curtis Maloney

On Mon, 23 Oct 2000, Taco Scargo wrote:
 I get errors when sequence-item is being called to list the contents of a
 folder

 E.g.
 dtml-in "(1,2,3)" reverse
 dtml-var sequence-item
 /dtml-in

 correctly outputs 3 2 1

 When I do

 dtml-in "folder.objectValues()"
 dtml-var id
 /dtml-in

 it correctly outputs all ids in the folder.

 But

 dtml-in "folder.objectValues()"
 dtml-var sequence-item
 /dtml-in

 will fail with an error
 Error Type: AttributeError
 Error Value: __call__

 What am I doing wrong ?


Your problem appears to be in the using of objectValues().  This returns the 
actual objects.  So, in the second loop (dtml-var id)  you are referencing 
the 'id' member of each object.  Nothing wrong there.

However, in the third loop (dtml-var sequence-item) you are trying to 
render the object itself.  This will 'call' each object, which some of them 
(obviously) object to. (No pun intended)

If you want to render all the DTML Documents and DTML Methods in the folder , 
try something like:

dtml-in "folder.objectValues(['DTML Document', 'DTML Method'])"
  dtml-var sequence-item
/dtml-in

but this could get very messy with a large folder. (o8

 Thanks,

 Taco Scargo


Have a better one,
Curtis Maloney

___
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] Problems with sequence-item

2000-10-22 Thread Mark N. Gibson

 
 I get errors when sequence-item is being called to list the contents of a
 folder
 
 E.g.
 dtml-in "(1,2,3)" reverse
 dtml-var sequence-item
 /dtml-in
 
 correctly outputs 3 2 1
 
 When I do
 
 dtml-in "folder.objectValues()"
 dtml-var id
 /dtml-in
 
 it correctly outputs all ids in the folder.
 
 But
 
 dtml-in "folder.objectValues()"
 dtml-var sequence-item
 /dtml-in
 
 will fail with an error
 Error Type: AttributeError
 Error Value: __call__
 
 What am I doing wrong ?
 

In this example, dtml-var sequence-item is actually trying to call the items
in the folder.  In this case, at least one of the items is not callable ( like 
another folder).  If you did something like this:

dtml-in "folder.objectValues('DTML Method')"
dtml-var sequence-item
/dtml-in

You would see the results of 'viewing' or calling every DTML Method in folder.

Mark

 Thanks,
 
 Taco Scargo
 
 
 
 
 
1stUp.com - Free the Web
Get your free Internet access at http://www.1stUp.com
 
 ___
 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 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] Problems with sequence-item

2000-10-22 Thread Taco Scargo

Had already tried that, but it doesn't work.
I have 8 DTML Documents in a folder called artikelen.

dtml-in "artikelen.objectValues('DTML Document')"
dtml-var sequence-item
/dtml-in

Fails with the error:
Error Type: AttributeError
Error Value: __call__

I am really clueless

Thanks,

Taco
- Original Message -
From: "Mark N. Gibson" [EMAIL PROTECTED]
To: "Taco Scargo" [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Sunday, October 22, 2000 3:52 PM
Subject: Re: [Zope] Problems with sequence-item
 In this example, dtml-var sequence-item is actually trying to call the
items
 in the folder.  In this case, at least one of the items is not callable
 like
 another folder).  If you did something like this:

 dtml-in "folder.objectValues('DTML Method')"
 dtml-var sequence-item
 /dtml-in

 You would see the results of 'viewing' or calling every DTML Method in
folder.

 Mark


___
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] Problems with sequence-item

2000-10-22 Thread Curtis Maloney

On Mon, 23 Oct 2000, Taco Scargo wrote:
 Had already tried that, but it doesn't work.
 I have 8 DTML Documents in a folder called artikelen.

 dtml-in "artikelen.objectValues('DTML Document')"
 dtml-var sequence-item
 /dtml-in

 Fails with the error:
 Error Type: AttributeError
 Error Value: __call__

 I am really clueless


Any chance you could post the WHOLE traceback, so we might be able to see 
which object it's choking on?

 Thanks,

 Taco

Curtis.

___
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] Problems with sequence-item

2000-10-22 Thread Taco Scargo

Please feel free to look at it at

http://www.gezondheidskrant.nl:8080/mainframe

Taco
- Original Message -
From: "Curtis Maloney" [EMAIL PROTECTED]
To: "Taco Scargo" [EMAIL PROTECTED]; "Mark N. Gibson" [EMAIL PROTECTED];
[EMAIL PROTECTED]
Sent: Sunday, October 22, 2000 6:57 PM
Subject: Re: [Zope] Problems with sequence-item
 Any chance you could post the WHOLE traceback, so we might be able to see
 which object it's choking on?


___
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] Problems with sequence-item

2000-10-22 Thread Ender

I thought at first this might be a permission problem, but after
browsing around the site. i'm pretty sure its a calling issue. its hard
to say for sure given the lack of details.

Taco, i'm pretty sure your objectValues on the addressen folder to fill
in to fill in the addresses of the artiklen document. zope renders these
subtemplates slightly differently than a template called directly by the
browser, when you're calling the addressen subobject from the document
call it like this

dtml-var "addressen.YOURADDRESS(_.None, _)"

or in a dtml-in

dtml-let x=sequence-item
dtml-var "x(_.None,_)"
/dtml-let


if that doesn't solve it for you, than it would be helpful to have the
relevant src of the document. i tried without success to duplicate the
exact same error, but i'm pretty sure that the problem has something to
do with this.


Kapil



Taco Scargo wrote:
 
 Please feel free to look at it at
 
 http://www.gezondheidskrant.nl:8080/mainframe
 
 Taco
 - Original Message -
 From: "Curtis Maloney" [EMAIL PROTECTED]
 To: "Taco Scargo" [EMAIL PROTECTED]; "Mark N. Gibson" [EMAIL PROTECTED];
 [EMAIL PROTECTED]
 Sent: Sunday, October 22, 2000 6:57 PM
 Subject: Re: [Zope] Problems with sequence-item
  Any chance you could post the WHOLE traceback, so we might be able to see
  which object it's choking on?
 
 ___
 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 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 )