[Zope] "Treeing" a dictionary

2001-01-25 Thread Gary Perez

Hi, all.

I've been playing with the XML Document product and the 
tags. Works quite nicely. Is there any way to duplicate this "treeing"
in Zope for a dictionary (with embedded dictionaries) coming in from an
external method?

For example, the external method is returning to Zope something like this:
{'Category 1': {'Section 1': {'Key 1': 'Value 1.1.1', 'Key 2': 'Value
1.1.2'}}, {'Section 2': {'Key 1': 'Value 1.2.1', 'Key 2': 'Value 1.2.2'}}}

Or, a little easier on the eyes:
{'Category 1':
{'Section 1':
{'Key 1': 'Value 1.1.1', 'Key 2': 'Value 1.1.2'}
},
{'Section 2':
{'Key 1': 'Value 1.2.1', 'Key 2': 'Value 1.2.2'}
}
}

Is there some way in Zope to tree this dictionary up like so (expanded)?:

[-] Category 1
[-] Section 1
Key 1
Key 2
[-] Section 2
Key 1
Key 2

Alternately, what type of objects is the  tag looking for
when constructing the tree? Would it be easier to "programatically"
generate those types of objects from the dictionary using either DTML or
an external python module?

Any help or insight is greatly appreciated.
-Gary

___
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] Sending Application to User?

2000-11-17 Thread Gary Perez

Hello, all.

Here's what we're trying to do:

User clicks on a link to open a remote interface to Box A on the
network. The "remote interface" is really a python script that's run by
Python on the client machine (not the Zope Box or "Box A").

We got it to work by specifying the MIME type in a DTML Method followed
by the python code itself, again inside the DTML Method.

Is there any way to first specify the MIME type in a DTML Method, and
then point to either a) a .py file object in Zope, or b) a .py file in
the external file system?

I really don't want to edit the code in the method every time the module
changes... I'd much rather just upload the new .py file.

A  would be great... if it
existed. ;)

Any guidance is greatly appreciated.
-Gary

___
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] Can Zope use a Different Python?

2000-11-10 Thread Gary Perez

Hi.

We've got Zope 2.2.2 installed on a Linux box. We want to be able to use
the full-up python that's on the box instead of the python interpreter
that comes with Zope for playing with External Methods.

Is there any way to circumvent Zope's python in this way?

If not, what's the easiest way to extend Zope to be able to use our
non-Zope python?

Alternatively, we're plagued by import and attribute errors when
accessing the External Methods. Will simply moving (or linking?) all the
pieces (whatever.py, __init__.py, etc.) into a subdirectory of "Shared"
fix the problem?

Thanks in advance for your help.
-GMP

___
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] Namespaces? DTML Methods? Properties? Oh my.

2000-05-19 Thread Gary Perez

Hello all.

First, a warning: I'm probably the newest of all Zope newbies. I'll do
my best to formulate some semblance of an intelligent question.

I'm having a namespace meltdown. Here's what's going on...

I have a ZClass called "Company" which has attribute "id", and a ZClass
called "Project" which has attribute "CompanyID" among others.

I'm trying to call and render only those Projects that have a CompanyID
that matches the Company object's "id" attribute. I'm doing this in the
"index_html" of the Company ZClass by calling a DTML Method
"retrieveCompanyProjects"... which resides in the folder "Company_List".
Here's the pertinent tree structure:

/
Company_List/
Company1/
Company2/
retrieveCompanyProjects (DTML Method)

Control Panel/
Products/
ASTi/
Company (ZClass)
index_html
Project (ZClass)

Projects/
Project1/
Project2/

Now... the procedure is successful when rendering only those Projects
that match a specific FSSession userid, as such:

## DTML Method 1 Excerpt:



## "retrieveUsersProjects" DTML Method Excerpt:











succeed , 

fail 




##

I've tried to use the same mechanism in the "retrieveCompanyProjects"
DTML Method, and here's where the namespace meltdown turns my brain to mush.

Here's the "retrieveCompanyProjects" DTML Method, which (to reiterate)
is called from the "index_html" method inside the Company ZClass:

##










succeed , 

fail 





##

My problem is that I can't for the life of me figure out what to replace
the "COMPANY_ATTRIBUTE_NAMED_ID" with in order to make it work.
User-specific is easy... it's simply FSSession['userid'].

Due to the position of the  following the , however,
I'm in the namespace of Projects, right? That being considered, the
property "id" is at that point the "id" of the Project, and not of the
Company anymore, no?

How can I go out, and snag a Company's property "id" from within that
namespace? Can I do a  ???  to pop the Company
namespace on the top of the stack & kick it out after getting the "id"?

Or, alternatively, is there a way that I can pass the variable "id" from
the Company namespace into the DTML method so it's there, recognized,
and used to filter the Projects?

Sorry this was so long, but any help would be greatly appreciated. I'm confused.

Thanks,
-Gary
-- 
Gary Perez
Advanced Simulation Technology, inc.
http://www.asti-usa.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 )