Commit 2de90ac3 authored by Yoshinori Okuji's avatar Yoshinori Okuji

Forgot to commit. Sorry.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@4465 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent ad7efaf9
# Copyright (c) 2001 New Information Paradigms Ltd
# Copyright (c) 2002 Nexedi SARL and Contributors. All Rights Reserved.
#
# This Software is released under the MIT License:
# http://www.opensource.org/licenses/mit-license.html
# See license.txt for more details.
#
from Products.CMFCore.FSZSQLMethod import FSZSQLMethod
from Products.CMFCore.utils import expandpath
from Products.ZSQLMethods.SQL import SQL
def FSZSQLMethod_readFile(self, reparse):
fp = expandpath(self._filepath)
file = open(fp, 'r') # not 'rb', as this is a text file!
try:
data = file.read()
finally: file.close()
RESPONSE = {}
RESPONSE['BODY'] = data
self.PUT(RESPONSE,None)
def FSZSQLMethod_createZODBClone(self):
"""Create a ZODB (editable) equivalent of this object."""
# I guess it's bad to 'reach inside' ourselves like this,
# but Z SQL Methods don't have accessor methdods ;-)
s = SQL(self.id,
self.title,
self.connection_id,
self.arguments_src,
self.src)
s.manage_advanced(self.max_rows_,
self.max_cache_,
self.cache_time_,
self.class_name_,
self.class_file_)
return s
FSZSQLMethod._readFile = FSZSQLMethod_readFile
FSZSQLMethod._createZODBClone = FSZSQLMethod_createZODBClone
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment