RE: [Zope] AArgh. Zope-2_2-branch and head of CVS breaks SQLMethods.

2000-08-10 Thread Brian Lloyd

Thanks Anthony - I've checked in a fix to the 2.2 branch and 
the trunk.


Brian Lloyd[EMAIL PROTECTED]
Software Engineer  540.371.6909  
Digital Creations  http://www.digicool.com 




> -Original Message-
> From: Anthony Baxter [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, August 10, 2000 6:40 PM
> To: [EMAIL PROTECTED]
> Cc: [EMAIL PROTECTED]
> Subject: Re: [Zope] AArgh. Zope-2_2-branch and head of CVS breaks
> SQLMethods. 
> 
> 
> 
> Aha! Nailed it. It's the 1.131 version of OFS/Application.py
> 
> cvs log entry:
> 
> revision 1.131
> date: 2000/08/02 17:31:54;  author: brian;  state: Exp;  
> lines: +71 -46
> branches:  1.131.4;
> Merged fix for products with old-style initialization not 
> being properly
> filtered by permission in the filtered add list.
> 
> 
> Ok, the problem is that when it sees an initialize() method, it
> stops looking for other stuff. ZSQLMethods has a __methods__ 
> thing, tho. Oops. Patch appended to make it always look for
> __methods__.
> 
> Note that it doesn't break ZSQLMethods from working, just 
> from being added
> or edited.
> 
> Argh. This would've been much easier to figure out if I 
> hadn't managed 
> to confuse myself (tooo many installations of zope, all 
> slightly different -
> need to make it better :)
> 
> Anthony
> 
> >>> Anthony Baxter wrote
> > 
> > The current Zope-2_2-branch and head of CVS is busted - you 
> cannot add or
> > edit SQLMethods. It appears that 
> Products.ZSQLMethods.__init__.__methods__ 
> > doesn't get into the namespace of the product properly, as neither
> > the add or edit screens can see SQLConnectionIDs.
> > 
> > Blah. More to come - I'll try to figure out why it's 
> broken, and when.
> > 
> > Anthony
> 
> 
> 

___
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] AArgh. Zope-2_2-branch and head of CVS breaks SQLMethods.

2000-08-10 Thread Anthony Baxter


Aha! Nailed it. It's the 1.131 version of OFS/Application.py

cvs log entry:

revision 1.131
date: 2000/08/02 17:31:54;  author: brian;  state: Exp;  lines: +71 -46
branches:  1.131.4;
Merged fix for products with old-style initialization not being properly
filtered by permission in the filtered add list.


Ok, the problem is that when it sees an initialize() method, it
stops looking for other stuff. ZSQLMethods has a __methods__ 
thing, tho. Oops. Patch appended to make it always look for
__methods__.

Note that it doesn't break ZSQLMethods from working, just from being added
or edited.

Argh. This would've been much easier to figure out if I hadn't managed 
to confuse myself (tooo many installations of zope, all slightly different -
need to make it better :)

Anthony

>>> Anthony Baxter wrote
> 
> The current Zope-2_2-branch and head of CVS is busted - you cannot add or
> edit SQLMethods. It appears that Products.ZSQLMethods.__init__.__methods__ 
> doesn't get into the namespace of the product properly, as neither
> the add or edit screens can see SQLConnectionIDs.
> 
> Blah. More to come - I'll try to figure out why it's broken, and when.
> 
> Anthony




Index: Application.py
===
RCS file: /cvsroot/Zope/lib/python/OFS/Application.py,v
retrieving revision 1.1.1.3
diff -u -r1.1.1.3 Application.py
--- Application.py	2000/08/07 04:22:29	1.1.1.3
+++ Application.py	2000/08/10 12:41:15
@@ -507,20 +507,6 @@
 meta_type['product']=productObject.id
 meta_types.append(meta_type)
 
-for name,method in pgetattr(
-product, 'methods', {}).items():
-if not hasattr(Folder, name):
-setattr(Folder, name, method)
-if name[-9:]!='__roles__': # not Just setting roles
-if (permissions.has_key(name) and
-not folder_permissions.has_key(
-permissions[name])):
-permission=permissions[name]
-if new_permissions.has_key(permission):
-new_permissions[permission].append(name)
-else:
-new_permissions[permission]=[name]
-
 if new_permissions:
 new_permissions=new_permissions.items()
 for permission, names in new_permissions:
@@ -528,6 +514,19 @@
 new_permissions.sort()
 Folder.__dict__['__ac_permissions__']=tuple(
 list(Folder.__ac_permissions__)+new_permissions)
+
+for name,method in pgetattr(product, 'methods', {}).items():
+if not hasattr(Folder, name):
+setattr(Folder, name, method)
+if name[-9:]!='__roles__': # not Just setting roles
+if (permissions.has_key(name) and
+not folder_permissions.has_key(
+permissions[name])):
+permission=permissions[name]
+if new_permissions.has_key(permission):
+new_permissions[permission].append(name)
+else:
+new_permissions[permission]=[name]
 
 if os.environ.get('ZEO_CLIENT',''):
 # we don't want to install products from clients!



[Zope] AArgh. Zope-2_2-branch and head of CVS breaks SQLMethods.

2000-08-10 Thread Anthony Baxter


The current Zope-2_2-branch and head of CVS is busted - you cannot add or
edit SQLMethods. It appears that Products.ZSQLMethods.__init__.__methods__ 
doesn't get into the namespace of the product properly, as neither
the add or edit screens can see SQLConnectionIDs.

Blah. More to come - I'll try to figure out why it's broken, and when.

Anthony

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