def loadProjects(group_data): print("In Load projects") if len(Groups.objects.all()) > 0: Groups.drop_collection() print("Dropping collections") # group_data = dataSet(group_path) for line in group_data: print("parsing: " + line) parseGroups(line)
def buildDB(student_path, group_path): #assert(len(student_path) > 0) if len(Groups.objects.all()) > 0: Groups.drop_collection() if len(Students.objects.all()) > 0: Students.drop_collection() student_data = dataSet(student_path) group_data = dataSet(group_path) for line in group_data.readData: g = parseGroups(line) # TODO add proper mongoengine command here if this doesn't work for line in student_data.readData: s = parseStudent(line)