Added delete for non-sync'd objects. Resolves #9 and #82
diff --git a/xos/dependency_walker.py b/xos/dependency_walker.py
index ba9de11..d99b783 100644
--- a/xos/dependency_walker.py
+++ b/xos/dependency_walker.py
@@ -46,7 +46,7 @@
deps = dependencies[model]
except:
deps = []
- __walk_deps(fn, object, deps)
+ return __walk_deps(fn, object, deps)
def walk_inv_deps(fn, object):
model = object.__class__.__name__
@@ -54,10 +54,11 @@
deps = inv_dependencies[model]
except:
deps = []
- __walk_deps(fn, object, deps)
+ return __walk_deps(fn, object, deps)
def __walk_deps(fn, object, deps):
model = object.__class__.__name__
+ ret = []
for dep in deps:
#print "Checking dep %s"%dep
peer=None
@@ -87,8 +88,10 @@
#if (isinstance(o,PlCoreBase)):
if (hasattr(o,'updated')):
fn(o, object)
+ ret.append(o)
# Uncomment the following line to enable recursion
# walk_inv_deps(fn, o)
+ return ret
def p(x,source):
print x,x.__class__.__name__
@@ -96,11 +99,9 @@
def main():
#pdb.set_trace()
- import django
- django.setup()
- s = Site.objects.filter(login_base='onlab')
+ s = Slice.objects.filter(name='princeton_sapan62')
#pdb.set_trace()
- walk_inv_deps(p,s[0])
+ print walk_inv_deps(p,s[0])
if __name__=='__main__':
main()