[Zope] Transparent Folders

2000-12-10 Thread Brenton Bills

Hi,
v0.2

I attempting to use transparent folders.

Like Andrew Milton's suggestions on using them to unclutter your tree, I 
wanted (want)
to put all SQL methods in a folder in the root of my zope tree. From under this
I wanted to put various tranparent folders grouping likewise functionality, eg,

sqlMethods /
Students / 
  get_all_students
  get_all_students_gpa
Teachers /
  get_all_teachers


I would like to go,

dtml-in get_all_students

/dtml-in

And reverse aquisition will do its stuff and run the get_all_students
in the Students folders.

Sadly its not working though, am I correct in thinking that this functionality
exists? Am I missing a patch or something?

Thanks, 
Brenton Bills.




___
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] Transparent Folders can unable SQL Methods...

2000-11-17 Thread Ghuo

Hi all,


I am using both transparent folders (created by Shane)  and sql methods.
SQL Methods are using "SQLConnectionIDs" method which return the list of
all the connections founded in the content of the current folder. I put
all my connections in a transparent folder and the "SQLConnectionIDs"
method returned always an empty list. I was not able any more to create
new sql methods... Here is a patch of this method located in the python
file "lib/python/Products/ZSQLMethods/SQL.py" which makes all work
well...


Frederic Quin
Profile For You SARL, France


PATCH
--

def TF_SQLConnectionIDs(self,ids):
have_id=ids.has_key
StringType=type('')

if hasattr(self, 'objectValues'):
   for o in self.objectValues():
  if (hasattr(o,'_isAnSQLConnection') and o._isAnSQLConnection
and hasattr(o,'id')):
 id=o.id
 if type(id) is not StringType: id=id()
 if not have_id(id):
if hasattr(o,'title_and_id'): o=o.title_and_id()
else: o=id
ids[id]=id

  if (hasattr(o,'meta_type') and (o.meta_type == 'Transparent
Folder')):
 ids = TF_SQLConnectionIDs(o,ids)

return ids



def SQLConnectionIDs(self):
"""Find SQL database connections in the current folder and above

This function return a list of ids.
"""
ids={}
have_id=ids.has_key
StringType=type('')

while self is not None:
if hasattr(self, 'objectValues'):
for o in self.objectValues():
if (hasattr(o,'_isAnSQLConnection') and
o._isAnSQLConnection
and hasattr(o,'id')):
id=o.id
if type(id) is not StringType: id=id()
if not have_id(id):
if hasattr(o,'title_and_id'): o=o.title_and_id()

else: o=id
ids[id]=id

if (o.meta_type == 'Transparent Folder'):
   ids = TF_SQLConnectionIDs(o,ids)

if hasattr(self, 'aq_parent'): self=self.aq_parent
else: self=None

ids=map(lambda item: (item[1], item[0]), ids.items())
ids.sort()
return ids

/ PATCH
-


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