]> git.parisson.com Git - teleforma.git/commitdiff
Merge branch 'crfpaold' into crfpa
authoryomguy <yomguy@parisson.com>
Fri, 8 Feb 2013 14:42:54 +0000 (15:42 +0100)
committeryomguy <yomguy@parisson.com>
Fri, 8 Feb 2013 14:42:54 +0000 (15:42 +0100)
Conflicts:
teleforma/management/commands/teleforma-import-conferences.py

1  2 
teleforma/management/commands/teleforma-import-courses-xls.py

index 755b0658cd37b881a2c94ce1fcca3900397e05e6,755b0658cd37b881a2c94ce1fcca3900397e05e6..49e8f1e5cef0009f9b57e4b6db4b9c568ef2bb67
@@@ -25,21 -25,21 +25,19 @@@ class Command(BaseCommand)
          sheet = self.book.sheet_by_index(0)
          col = sheet.col(0)
  
--        for course in Course.objects.all():
--            course.delete()
--
          department = os.path.splitext(os.path.basename(path))[0]
          organization, created = Organization.objects.get_or_create(name=organization)
          department, created = Department.objects.get_or_create(name=department,
                                                                 organization=organization)
  
          for i in range(self.first_row, len(col)):
--            course, created = Course.objects.get_or_create(title=sheet.row(i)[0].value,
++            course, c = Course.objects.get_or_create(title=sheet.row(i)[0].value,
                                                                 code=sheet.row(i)[1].value,
                                                                 number=int(sheet.row(i)[2].value),
--                                                               department=department,
--                                                            )
++                                                               department=department,)
++            course.tweeter_title = sheet.row(i)[3].value
++            course.save()
  
--            if created:
++            if c:
                  print 'imported: ' + course.title