Editing ZSQLMethods Through WebDAV |
![]() |
Created by pupq . Last modified 2003-10-02 03:18:33. |
A patch to allow editing of ZSQLMethods through WebDAV |
ZSQLMethods can be just as complicated as any script or template -- and just as annoying to edit in a tiny TEXTAREA box. You can edit them with Casey Duncan's ever-cool External Editor, but if you prefer to edit your site with WebDAV (perhaps you spend most of your time in a GUI web editor), this doesn't work. There's a small bug in ZSQLMethds: they don't expose a part of the API required for WebDAV. To hotfix, add a Product folder with this as the __init__.py method. (Or, if you have several hotfixes, call this whatever you like, and import it from your existing __init__.py): """Allow ZSQLMethods to be used under WebDAV by adding a get_size function""" from Products.ZSQLMethods.SQL import SQL def get_size(self): """Return length""" return len(self.manage_FTPget()) SQL.get_size = get_size SQL.getSize = get_size |