[Zope] PSQLINPUT Wizard Error

Martijn Pieters mj@antraciet.nl
Sat, 09 Oct 1999 13:26:54 +0200


At 07:07 9-10-99 , Ping Lau wrote:
>Hi Martijn,
>
>Thank you very much.  May I ask what is the difference between your &
>Philipp's patch?  I am still learning & want to learn from the pro.
>
>Regards,
>Ping
>
>
>Philip:
> >>self.aq_parent._setObject(sqlId, Products.ZSQLMethods.SQL.SQL(sqlId,
> >>sqlTitle,
> >>     self.connection_id, args, command))
>
>Me:
> >Better still: Change it to:
> >
> >   addZSQL=self.aq_parent.manage_addProduct['manage_addZSQLMethod']
> >   addZSQL.manage_addZSQLMethod(sqlId, sqlTitle, self.connection_id,
> >       args, command)

In Zope 1.x, the construction methods for a Product were added directly to 
the Folder class. But with the new Product registration API, construction 
methods are now collected in a special collection of the manage_addProduct 
object. This is why the P SQL Input Wizard was broken.

Philip's method bypasses the construction methods altogether, and tries to 
do the same thing that such a construction method does. It calls _setObject 
on the current Folder with a new instance of the SQL class.

My Method makes use of the new path of the constructor method, thus using 
any other code that constructor method uses or may use in the future.

--
Martijn Pieters, Web Developer
| Antraciet http://www.antraciet.nl
| T: +31 35 7502100 F: +31 35 7502111
| mj@antraciet.nl http://www.antraciet.nl/~mj
| PGP: http://wwwkeys.nl.pgp.net:11371/pks/lookup?op=get&search=0xA8A32149
---------------------------------------------