git://git.onelab.eu
/
sfa.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
3349688
)
make _quote() static so other classes can use it
author
Tony Mack
<tmack@paris.CS.Princeton.EDU>
Fri, 3 Feb 2012 22:23:39 +0000
(17:23 -0500)
committer
Tony Mack
<tmack@paris.CS.Princeton.EDU>
Fri, 3 Feb 2012 22:23:39 +0000
(17:23 -0500)
sfa/storage/filter.py
patch
|
blob
|
history
diff --git
a/sfa/storage/filter.py
b/sfa/storage/filter.py
index
3a333d5
..
8dbfe77
100644
(file)
--- a/
sfa/storage/filter.py
+++ b/
sfa/storage/filter.py
@@
-1,8
+1,7
@@
-from types import StringTypes
import types
import types
+import datetime
from sfa.util.faults import SfaInvalidArgument
from sfa.util.faults import SfaInvalidArgument
-
from sfa.storage.parameter import Parameter, Mixed, python_type
class Filter(Parameter, dict):
from sfa.storage.parameter import Parameter, Mixed, python_type
class Filter(Parameter, dict):
@@
-91,9
+90,10
@@
class Filter(Parameter, dict):
else:
return self._quote(value)
else:
return self._quote(value)
- # pgdb._quote isn't supported in python 2.7/f16, so let's implement it here
+ # pgdb._quote isn't supported in python 2.7/f16, so let's implement it here
+ @staticmethod
def _quote(x):
def _quote(x):
- if isinstance(x,
DateTimeTyp
e):
+ if isinstance(x,
datetim
e):
x = str(x)
elif isinstance(x, unicode):
x = x.encode( 'utf-8' )
x = str(x)
elif isinstance(x, unicode):
x = x.encode( 'utf-8' )
@@
-109,7
+109,7
@@
class Filter(Parameter, dict):
elif hasattr(x, '__pg_repr__'):
x = x.__pg_repr__()
else:
elif hasattr(x, '__pg_repr__'):
x = x.__pg_repr__()
else:
- raise
Interfac
eError, 'do not know how to handle type %s' % type(x)
+ raise
Typ
eError, 'do not know how to handle type %s' % type(x)
return x
return x