示例#1
0
文件: basic.py 项目: rtighe/rapidsms
 def testVerifyFamilyTree(self):
     print "\n\n\n############## testVerifyFamilyTree"
     Organization.objects.all().delete()
     ExtUser.objects.all().delete()
     Edge.objects.all().delete()
     EdgeType.objects.all().delete()
     
     
     management.call_command('runscript', 'demo_bootstrap.py', verbosity=0)
     
     for org in Organization.objects.all():
         ancestry = traversal.getFamilyTreeForObject(org)
         print "Object: " + str(org)
         print "Ancestors: " + str(ancestry)
         
     for usr in ExtUser.objects.all():
         ancestry = traversal.getFamilyTreeForObject(usr)
         print "Object: " + str(usr)
         print "Ancestors: " + str(ancestry)
示例#2
0
 def render(self, context):
     # context[self.var_name] = AuxiliaryID.objects.all().filter(patient=self.patient)
     # [ancestry as list]
     context[self.var_name] = traversal.getFamilyTreeForObject(self.edge)
     return ""