def load_db(): sys.path.append("../data") from international_projects import projects int_faculty = set() p_fac = set() book = country_codes() # add countries for c in book: country = Country() country.name = c country.country_id = book[c] print 'created', country country.save() print 'saved', country for p in projects: project = Project() project.title = p['title'] print p['title'] #print project if 'description' in p: project.description = p['description'] print " added description" if 'partners' in p: project.partners = p['partners'] project.save() print " saving" print " added partners" for f in p['faculty']: print " creating/looking for", f try: person = Person.objects.get(full_name=f) print " found", f except: person = Person() person.full_name = f person.save() print " created", f project.people.add(person) for c in p['countries']: country = Country.objects.get(name=c) project.countries.add(country) project.save() # load things from graph for name, node in g.nodes(data=True): pass