git://git.onelab.eu
/
sfa.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge Master in geni-v3 conflict resolution
[sfa.git]
/
sfa
/
storage
/
record.py
diff --git
a/sfa/storage/record.py
b/sfa/storage/record.py
index
1aa3aa9
..
812efde
100644
(file)
--- a/
sfa/storage/record.py
+++ b/
sfa/storage/record.py
@@
-33,7
+33,8
@@
class Record:
# fallback
return "** undef_datetime **"
# fallback
return "** undef_datetime **"
- # it may be important to exclude relationships
+ # it may be important to exclude relationships, which fortunately
+ #
def todict (self, exclude_types=[]):
d=self.__dict__
def exclude (k,v):
def todict (self, exclude_types=[]):
d=self.__dict__
def exclude (k,v):
@@
-41,7
+42,6
@@
class Record:
if exclude_types:
for exclude_type in exclude_types:
if isinstance (v,exclude_type): return True
if exclude_types:
for exclude_type in exclude_types:
if isinstance (v,exclude_type): return True
- if isinstance (v,list) and v and isinstance (v[0],exclude_type) : return True
return False
keys=[k for (k,v) in d.items() if not exclude(k,v)]
return dict ( [ (k,d[k]) for k in keys ] )
return False
keys=[k for (k,v) in d.items() if not exclude(k,v)]
return dict ( [ (k,d[k]) for k in keys ] )