Changeset 7752 for main/waeup.sirp/trunk/src
- Timestamp:
- 2 Mar 2012, 13:35:41 (13 years ago)
- Location:
- main/waeup.sirp/trunk/src/waeup/sirp/university
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.sirp/trunk/src/waeup/sirp/university/export.py
r7740 r7752 95 95 96 96 #: Fieldnames considered by this exporter 97 fields = ('code', 'faculty ', 'title', 'title_prefix')97 fields = ('code', 'faculty_code', 'title', 'title_prefix') 98 98 99 99 def mangle_value(self, value, name, context=None): 100 100 """Hook for mangling values in derived classes 101 101 """ 102 if name == 'faculty ':102 if name == 'faculty_code': 103 103 value = getattr( 104 104 getattr(context, '__parent__', None), … … 127 127 128 128 #: Fieldnames considered by this exporter 129 fields = ('code', 'faculty ', 'department', 'title', 'credits',129 fields = ('code', 'faculty_code', 'department_code', 'title', 'credits', 130 130 'passmark', 'semester') 131 131 … … 133 133 """Hook for mangling values in derived classes 134 134 """ 135 if name == 'faculty ':135 if name == 'faculty_code': 136 136 try: 137 137 value = context.__parent__.__parent__.__parent__.code 138 138 except AttributeError: 139 139 value = None 140 elif name == 'department ':140 elif name == 'department_code': 141 141 value = getattr( 142 142 getattr(context, '__parent__', None), -
main/waeup.sirp/trunk/src/waeup/sirp/university/tests/test_export.py
r7739 r7752 149 149 self.assertEqual( 150 150 result, 151 'code,faculty ,title,title_prefix\r\n'151 'code,faculty_code,title,title_prefix\r\n' 152 152 'D1,F1,Department of Cheddar,department\r\n' 153 153 ) … … 160 160 self.assertEqual( 161 161 result, 162 'code,faculty ,title,title_prefix\r\n'162 'code,faculty_code,title,title_prefix\r\n' 163 163 'D1,F1,Department of Cheddar,department\r\n' 164 164 'D2,F1,Institue of Gouda,institute\r\n' … … 173 173 self.assertEqual( 174 174 result, 175 'code,faculty ,title,title_prefix\r\n'175 'code,faculty_code,title,title_prefix\r\n' 176 176 'D1,F1,Department of Cheddar,department\r\n' 177 177 'D2,F1,Institue of Gouda,institute\r\n' … … 186 186 self.assertEqual( 187 187 result, 188 'code,faculty ,title,title_prefix\r\n'188 'code,faculty_code,title,title_prefix\r\n' 189 189 'D1,F1,Department of Cheddar,department\r\n' 190 190 'D2,F1,Institue of Gouda,institute\r\n' … … 242 242 self.assertEqual( 243 243 result, 244 'code,faculty ,department,title,credits,passmark,semester\r\n'244 'code,faculty_code,department_code,title,credits,passmark,semester\r\n' 245 245 'C1,F1,,Cheese Basics,0,40,1\r\n' 246 246 ) … … 253 253 self.assertEqual( 254 254 result, 255 'code,faculty ,department,title,credits,passmark,semester\r\n'255 'code,faculty_code,department_code,title,credits,passmark,semester\r\n' 256 256 'C1,F1,,Cheese Basics,0,40,1\r\n' 257 257 'C2,F1,,Advanced Cheese Making,0,40,1\r\n' … … 266 266 self.assertEqual( 267 267 result, 268 'code,faculty ,department,title,credits,passmark,semester\r\n'268 'code,faculty_code,department_code,title,credits,passmark,semester\r\n' 269 269 'C1,F1,,Cheese Basics,0,40,1\r\n' 270 270 'C2,F1,,Advanced Cheese Making,0,40,1\r\n' … … 279 279 self.assertEqual( 280 280 result, 281 'code,faculty ,department,title,credits,passmark,semester\r\n'281 'code,faculty_code,department_code,title,credits,passmark,semester\r\n' 282 282 'C1,F1,,Cheese Basics,0,40,1\r\n' 283 283 'C2,F1,,Advanced Cheese Making,0,40,1\r\n'
Note: See TracChangeset for help on using the changeset viewer.