Commit 623b21a5 authored by Jim Fulton's avatar Jim Fulton

- Began adding support for using pickles in network protocol.

  This support is currently disabled due to security and performance issues,
  especially wrt Missing and Date values.

- Fixed cache problem, I guess.
parent ede5872d
import ExtensionClass
from string import strip, lower, upper
import string
from string import strip, lower, upper, join
from Acquisition import Implicit
from Record import Record
......@@ -91,3 +92,42 @@ class Results:
if parent is None: return fields
return fields.__of__(parent)
def asRDB(self): # Waaaaa
r=[]
append=r.append
strings=[]
nstrings=[]
items=self.__items__
indexes=range(len(items))
join=string.join
for i in indexes:
item=items[i]
t=lower(item['type'])
if t=='s' or t=='t':
t=='t'
strings.append(i)
else: nstrings.append(i)
if item.has_key('width'): append('%s%s' % (item['width'], t))
else: r.append(t)
r=[join(self._names, '\t'), join(r,'\t')]
append=r.append
find=string.find
split=string.split
row=['']*len(items)
tostr=str
for d in self._data:
for i in strings:
v=tostr(d[i])
if v:
if find(v,'\\') > 0: v=join(split(v,'\\'),'\\\\')
if find(v,'\t') > 0: v=join(split(v,'\t'),'\\t')
if find(v,'\n') > 0: v=join(split(v,'\n'),'\\n')
row[i]=v
for i in nstrings:
row[i]=tostr(d[i])
append(join(row,'\t'))
append('')
return join(r,'\n')
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