Ignore:
Timestamp:
2 Mar 2012, 13:35:41 (13 years ago)
Author:
uli
Message:

Use faculty_code, etc. instead of faculty, because this is also used in imports.

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  
    9595
    9696    #: Fieldnames considered by this exporter
    97     fields = ('code', 'faculty', 'title', 'title_prefix')
     97    fields = ('code', 'faculty_code', 'title', 'title_prefix')
    9898
    9999    def mangle_value(self, value, name, context=None):
    100100        """Hook for mangling values in derived classes
    101101        """
    102         if name == 'faculty':
     102        if name == 'faculty_code':
    103103            value = getattr(
    104104                getattr(context, '__parent__', None),
     
    127127
    128128    #: Fieldnames considered by this exporter
    129     fields = ('code', 'faculty', 'department', 'title', 'credits',
     129    fields = ('code', 'faculty_code', 'department_code', 'title', 'credits',
    130130              'passmark', 'semester')
    131131
     
    133133        """Hook for mangling values in derived classes
    134134        """
    135         if name == 'faculty':
     135        if name == 'faculty_code':
    136136            try:
    137137                value = context.__parent__.__parent__.__parent__.code
    138138            except AttributeError:
    139139                value = None
    140         elif name == 'department':
     140        elif name == 'department_code':
    141141            value = getattr(
    142142                getattr(context, '__parent__', None),
  • main/waeup.sirp/trunk/src/waeup/sirp/university/tests/test_export.py

    r7739 r7752  
    149149        self.assertEqual(
    150150            result,
    151             'code,faculty,title,title_prefix\r\n'
     151            'code,faculty_code,title,title_prefix\r\n'
    152152            'D1,F1,Department of Cheddar,department\r\n'
    153153            )
     
    160160        self.assertEqual(
    161161            result,
    162             'code,faculty,title,title_prefix\r\n'
     162            'code,faculty_code,title,title_prefix\r\n'
    163163            'D1,F1,Department of Cheddar,department\r\n'
    164164            'D2,F1,Institue of Gouda,institute\r\n'
     
    173173        self.assertEqual(
    174174            result,
    175             'code,faculty,title,title_prefix\r\n'
     175            'code,faculty_code,title,title_prefix\r\n'
    176176            'D1,F1,Department of Cheddar,department\r\n'
    177177            'D2,F1,Institue of Gouda,institute\r\n'
     
    186186        self.assertEqual(
    187187            result,
    188             'code,faculty,title,title_prefix\r\n'
     188            'code,faculty_code,title,title_prefix\r\n'
    189189            'D1,F1,Department of Cheddar,department\r\n'
    190190            'D2,F1,Institue of Gouda,institute\r\n'
     
    242242        self.assertEqual(
    243243            result,
    244             'code,faculty,department,title,credits,passmark,semester\r\n'
     244            'code,faculty_code,department_code,title,credits,passmark,semester\r\n'
    245245            'C1,F1,,Cheese Basics,0,40,1\r\n'
    246246            )
     
    253253        self.assertEqual(
    254254            result,
    255             'code,faculty,department,title,credits,passmark,semester\r\n'
     255            'code,faculty_code,department_code,title,credits,passmark,semester\r\n'
    256256            'C1,F1,,Cheese Basics,0,40,1\r\n'
    257257            'C2,F1,,Advanced Cheese Making,0,40,1\r\n'
     
    266266        self.assertEqual(
    267267            result,
    268             'code,faculty,department,title,credits,passmark,semester\r\n'
     268            'code,faculty_code,department_code,title,credits,passmark,semester\r\n'
    269269            'C1,F1,,Cheese Basics,0,40,1\r\n'
    270270            'C2,F1,,Advanced Cheese Making,0,40,1\r\n'
     
    279279        self.assertEqual(
    280280            result,
    281             'code,faculty,department,title,credits,passmark,semester\r\n'
     281            'code,faculty_code,department_code,title,credits,passmark,semester\r\n'
    282282            'C1,F1,,Cheese Basics,0,40,1\r\n'
    283283            'C2,F1,,Advanced Cheese Making,0,40,1\r\n'
Note: See TracChangeset for help on using the changeset viewer.