Changeset 4279 for waeup


Ignore:
Timestamp:
13 Jun 2009, 14:15:51 (16 years ago)
Author:
uli
Message:

Fix course importer.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • waeup/branches/ulif-rewrite/src/waeup/university/facultycontainer.py

    r4269 r4279  
    144144        # object defined which refer to the CSV file and the container.
    145145        for row in self.csvfile.getData():
     146
    146147            new_item = createObject(u'waeup.Course')
     148           
    147149            faculty_code = row['faculty']
    148150            faculty = self.receiver[faculty_code]
    149             del row[faculty_code]
     151            del row['faculty']
     152
    150153            dept_code = row['department']
    151154            dept = faculty[dept_code]
    152             del row[dept_code]
     155            del row['department']
     156
    153157            for key, val in row.items():
    154158                setattr(new_item, key, val)
    155             dept.addCourse(new_item)
    156         return
    157 
     159            dept.courses.addCourse(new_item)
     160        return
    158161
    159162
Note: See TracChangeset for help on using the changeset viewer.