[Zope-dev] why is manage_addZSQLMethod unavailable ?

2000-08-18 Thread Hannu Krosing

Why does this work

dtml-call "_['testadd'].manage_addDTMLMethod('MethodId', 'Method
Title','method text')"


While this does not:

dtml-call "_['testadd'].manage_addZSQLMethod('ZSQLID', 'ZSQL Title',
'DB','','select * from data')"

Error Type: AttributeError
 Error Value: manage_addZSQLMethod

I studies the Znolk product and found that it uses _setObject directly
instead of 
manage_addZSQLMethod .

I was able to overcome it by defining an  one-line external method:

-
from  Products.ZSQLMethods.SQL import *

def manage_addZSQLMethod(self, sqlId, sqlTitle, connection_id, args, command):
self._setObject(sqlId, SQL(sqlId, sqlTitle, connection_id, args, command)) 
-

but it IMHO the visibility of manage_addDTMLMethod and manage_addZSQLMethod 
_should_ be the same ?

-
Hannu

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




Re: [Zope-dev] why is manage_addZSQLMethod unavailable ?

2000-08-18 Thread Rik Hoekstra





Why does this work

dtml-call "_['testadd'].manage_addDTMLMethod('MethodId', 'Method
Title','method text')"


While this does not:

dtml-call "_['testadd'].manage_addZSQLMethod('ZSQLID', 'ZSQL Title',
'DB','','select * from data')"

Error Type: AttributeError
 Error Value: manage_addZSQLMethod

I studies the Znolk product and found that it uses _setObject directly
instead of
manage_addZSQLMethod .


In general there is an inconsistency in adding objects: sometimes you can
use the manage_addYourProduct interface, and sometimes only going through
the addProduct invocation (don't have the whole thing handy here) will do
the trick. This can get very confusing. Wouldn't know if that's the matter
here, though. I think this should be standardized in the interfaces.


but it IMHO the visibility of manage_addDTMLMethod and manage_addZSQLMethod
_should_ be the same ?



I agree


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