From: Bryan Date: Thu, 9 Jan 2014 06:19:01 +0000 (-0500) Subject: fixing courses to be more properly unique when importing ocw data. X-Git-Tag: release-20150131~292 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=d20464628704a56b0071fc45c36dc61bc41d909f;p=oweals%2Fkarmaworld.git fixing courses to be more properly unique when importing ocw data. --- diff --git a/karmaworld/apps/notes/management/commands/import_ocw_json.py b/karmaworld/apps/notes/management/commands/import_ocw_json.py index 323be16..9365902 100644 --- a/karmaworld/apps/notes/management/commands/import_ocw_json.py +++ b/karmaworld/apps/notes/management/commands/import_ocw_json.py @@ -94,12 +94,13 @@ class Command(BaseCommand): # Extract the course info course_info = { 'name': course['courseTitle'], - 'instructor_name': course['professor'], - 'school': dbschool, + 'department': dbdept, } # Create or Find the Course object. dbcourse = Course.objects.get_or_create(**course_info)[0] dbcourse.professor = dbprof + dbcourse.instructor_name = course['professor'] + dbcourse.school = dbschool dbcourse.save() print "Course is in the database: {0}".format(dbcourse.name) @@ -165,7 +166,7 @@ class Command(BaseCommand): # Do tags separately dbnote.tags.add('mit-ocw','karma') - print "Sending to GDrive and saving note to database." + print "Converting document and saving note to database." try: convert_raw_document(dbnote) except ValueError, e: