[Zope] zclass and SQL (generating default methods ala zdiscussion)

- bak@nstp.com.my
Tue, 11 Apr 2000 14:29:08 +0800


hi again
seems my previous mail may not be clear enough.  any  how, i got a zclass with
a few default ZSQL methods.

i want to copy the default SQL Methods to the instance, but can't do it right
now.  i tried to do as what ZDiscussion did, but can't really proceed.  this is
my code snippets

---(id = generatemethod_dtml)--

<dtml-var manage_tabs>

<dtml-if Regenerate>
 <dtml-in "defaultSQL.objectItems('Z SQL Method')">
  <dtml-try>
   <dtml-call "manage_delObjects(ids=[_['sequence-item']])">
  <dtml-except>
  </dtml-try>
 <dtml-call "manage_addProduct['ZSQLMethods'].manage_addZSQLMethod(
               this(), id,
	title=_.getattr(defaultSQL, _['sequence-item']).title,
	connection_id=_.getattr(defaultSQL, _['sequence-item']).connection_id,
	arguments='_.getattr(defaultSQL, _['sequence-item']).arguments,
		template=_.getattr(defaultSQL, _['sequence-item']).template)">
<br>

 </dtml-in>
 Default methods regenerated.<br>
 <dtml-var ZopeTime>
 <hr>
</dtml-if>

<form>
 To restore this topic's methods to the default ones, click here:
 <input type="submit" value="Regenerate" name="Regenerate">
</form>
--end-----

defaultSQL is a folder containing all default ZSQL methods.

this is the traceback:
<!--
Traceback (innermost last):
  File /usr/local/Zope/lib/python/ZPublisher/Publish.py, line 214, in publish_module
  File /usr/local/Zope/lib/python/ZPublisher/Publish.py, line 179, in publish
  File /usr/local/Zope/lib/python/Zope/__init__.py, line 202, in zpublisher_exception_hook
    (Object: testf)
  File /usr/local/Zope/lib/python/ZPublisher/Publish.py, line 165, in publish
  File /usr/local/Zope/lib/python/ZPublisher/mapply.py, line 160, in mapply
    (Object: generatedefaultSQL)
  File /usr/local/Zope/lib/python/ZPublisher/Publish.py, line 102, in call_object
    (Object: generatedefaultSQL)
  File /usr/local/Zope/lib/python/OFS/DTMLMethod.py, line 150, in __call__
    (Object: generatedefaultSQL)
  File /usr/local/Zope/lib/python/DocumentTemplate/DT_String.py, line 502, in __call__
    (Object: generatedefaultSQL)
  File /usr/local/Zope/lib/python/DocumentTemplate/DT_In.py, line 691, in renderwob
    (Object: defaultSQL.objectItems('Z SQL Method'))
  File /usr/local/Zope/lib/python/DocumentTemplate/DT_Util.py, line 335, in eval
    (Object: manage_addProduct['ZSQLMethods'].manage_addZSQLMethod(
               this(),
               id,
        title=_.getattr(defaultSQL, _['sequence-item']).title,
        connection_id=_.getattr(defaultSQL, _['sequence-item']).connection_id,
        arguments=_.getattr(defaultSQL, _['sequence-item']).arguments,
                template=_.getattr(defaultSQL, _['sequence-item']).template))
    (Info: this)
  File <string>, line 0, in ?
  File /usr/local/Zope/lib/python/DocumentTemplate/DT_Util.py, line 161, in careful_getitem
  File /usr/local/Zope/lib/python/Shared/DC/ZRDB/DA.py, line 408, in __call__
    (Object: qry_add_msg)
  File /usr/local/Zope/lib/python/Shared/DC/ZRDB/Aqueduct.py, line 186, in _argdata
    (Object: qry_add_msg)
Bad Request: (see above)

-->

what am i missing here?  it looks like i passed the arguments wrongly.  
tia for pointers and help.


 -- 
------------------------------------------------------
http://www.kedai.com.my/kk
Am I Evil?