Changeset 7270


Ignore:
Timestamp:
4 Dec 2011, 17:50:45 (13 years ago)
Author:
Henrik Bettermann
Message:

Let's call the registration number reg_number instead of reg_no, like in students. Issoufou: This requires an update of the plugins on the portal configuration page.

Location:
main/waeup.sirp/trunk/src/waeup/sirp/applicants
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.sirp/trunk/src/waeup/sirp/applicants/applicant.py

    r7260 r7270  
    9191    access_code = index.Field(attribute='access_code')
    9292    applicant_id = index.Field(attribute='applicant_id')
    93     reg_no = index.Field(attribute='reg_no')
     93    reg_number = index.Field(attribute='reg_number')
    9494
    9595class ApplicantFactory(grok.GlobalUtility):
  • main/waeup.sirp/trunk/src/waeup/sirp/applicants/batching.py

    r7268 r7270  
    8888    def available_fields(self):
    8989        return sorted(list(set(
    90             ['application_number','reg_no'] + getFields(
     90            ['application_number','reg_number'] + getFields(
    9191                self.iface).keys())))
    9292
    9393    def checkHeaders(self, headerfields, mode='create'):
    94         if not 'reg_no' in headerfields and not 'application_number' \
     94        if not 'reg_number' in headerfields and not 'application_number' \
    9595            in headerfields:
    9696            raise FatalCSVError(
    97                 "Need at least columns application_number or reg_no ")
     97                "Need at least columns application_number or reg_number ")
    9898        if mode == 'create':
    9999            for field in self.required_fields:
     
    114114        if row.get('application_number',None):
    115115            return 'application_number'
    116         elif 'reg_no' in row.keys() and row['reg_no']:
    117             return 'reg_no'
     116        elif 'reg_number' in row.keys() and row['reg_number']:
     117            return 'reg_number'
    118118        else:
    119119            return None
     
    135135                applicant = parent[row['application_number']]
    136136                return applicant
    137         elif self.getLocator(row) == 'reg_no':
    138             reg_no = row['reg_no']
     137        elif self.getLocator(row) == 'reg_number':
     138            reg_number = row['reg_number']
    139139            cat = queryUtility(ICatalog, name='applicants_catalog')
    140140            results = list(
    141                 cat.searchResults(reg_no=(reg_no, reg_no)))
     141                cat.searchResults(reg_number=(reg_number, reg_number)))
    142142            if results:
    143143                return results[0]
     
    167167        for num, field in enumerate(headerfields):
    168168            if field not in ['container_code',
    169                 'application_number', 'reg_no'] and mode == 'remove':
     169                'application_number', 'reg_number'] and mode == 'remove':
    170170                continue
    171171            if field == u'--IGNORE--':
     
    179179        """
    180180        if mode in ['update', 'remove']:
    181             if self.getLocator(row) == 'reg_no':
     181            if self.getLocator(row) == 'reg_number':
    182182                iface = IApplicantUpdateByRegNo
    183183        else:
  • main/waeup.sirp/trunk/src/waeup/sirp/applicants/browser.py

    r7263 r7270  
    931931    form_fields = grok.AutoFields(IApplicantEdit).omit(
    932932        'locked', 'course_admitted', 'student_id',
    933         'screening_score', 'applicant_id', 'reg_no'
     933        'screening_score', 'applicant_id', 'reg_number'
    934934        )
    935935    form_fields['date_of_birth'].custom_widget = FriendlyDateWidget('le-year')
  • main/waeup.sirp/trunk/src/waeup/sirp/applicants/interfaces.py

    r7268 r7270  
    5353    implements(ISource)
    5454    cat_name = 'applicants_catalog'
    55     field_name = 'reg_no'
     55    field_name = 'reg_number'
    5656    validation_error = RegNumInSource
    5757    def __init__(self, context):
     
    298298        readonly = False,
    299299        )
    300     reg_no = TextLineChoice(
     300    reg_number = TextLineChoice(
    301301        title = u'JAMB Registration Number',
    302302        readonly = False,
     
    446446    """Representation of an applicant.
    447447
    448     Skip regular reg_no validation if reg_no is used for finding
     448    Skip regular reg_number validation if reg_number is used for finding
    449449    the applicant object.
    450450    """
    451     reg_no = schema.TextLine(
     451    reg_number = schema.TextLine(
    452452        title = u'Registration Number',
    453453        default = None,
  • main/waeup.sirp/trunk/src/waeup/sirp/applicants/tests/sample_applicant_data.csv

    r7263 r7270  
    1 container_code,reg_no,firstname,lastname,date_of_birth,email,course1
     1container_code,reg_number,firstname,lastname,date_of_birth,email,course1
    22dp2011,1001,Aaren,Pieri,1990-01-02,xx@yy.zz,CERT1
    33dp2011,1002,Aaren,Finau,1990-01-03,xx@yy.zz,CERT1
  • main/waeup.sirp/trunk/src/waeup/sirp/applicants/tests/sample_applicant_data_update.csv

    r7263 r7270  
    1 container_code,reg_no,firstname
     1container_code,reg_number,firstname
    22dp2011,1001,Aaren
    33dp2011,1002,Alfons
  • main/waeup.sirp/trunk/src/waeup/sirp/applicants/tests/test_browser.py

    r7263 r7270  
    118118        # Add an applicant
    119119        self.applicant = Applicant()
    120         # reg_no is the only field which has to be preset here
     120        # reg_number is the only field which has to be preset here
    121121        # because managers are allowed to edit this required field
    122         self.applicant.reg_no = u'1234'
     122        self.applicant.reg_number = u'1234'
    123123        app['applicants']['app2009'].addApplicant(self.applicant)
    124124        IUserAccount(
Note: See TracChangeset for help on using the changeset viewer.