Changeset 2099 for WAeUP_SRP


Ignore:
Timestamp:
15 Aug 2007, 19:39:58 (17 years ago)
Author:
Henrik Bettermann
Message:

some corrections (see email 'Befund')

Location:
WAeUP_SRP/trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • WAeUP_SRP/trunk/WAeUPTables.py

    r2094 r2099  
    5858    security = ClassSecurityInfo()
    5959    meta_type = None
    60    
     60
    6161    def __init__(self,name=None):
    6262        if name ==  None:
    6363            name = self.name
    6464        ZCatalog.__init__(self,name)
    65        
     65
    6666    def refreshCatalog(self, clear=0, pghandler=None): ###(
    6767        """ don't refresh for a normal table """
     
    391391    key = "reg_no"
    392392    security = ClassSecurityInfo()
    393    
     393
    394394    def __init__(self,name=None):
    395395        if name ==  None:
     
    415415            logger.error(em)
    416416            return
    417         logger = logging.getLogger('WAeUPTables.Applicants.importCSV')
     417        logger = logging.getLogger('WAeUPTables.ApplicantsCatalog.importCSV')
    418418        d = self._import(filename,schema,layout,mode,logger)
    419419        if len(d['valid_records']) > 0:
     
    557557        return certificate_res[0].getPath().split('/')[-4]
    558558
    559     def get_from_doc_end_level(self,doc,cached_data={}): 
     559    def get_from_doc_end_level(self,doc,cached_data={}):
    560560        "return the students end_level"
    561561        if doc is None:
     
    10041004        WAeUPTable.__init__(self, name)
    10051005        self._queue = []
    1006        
     1006
    10071007    def addRecord(self, **data): ###(
    10081008        """add one record"""
    1009        
     1009
    10101010        uid = key = "%(student_id)s|%(level_id)s|%(course_id)s" % data
    10111011        if key in self._queue:
     
    10231023        return uid
    10241024    ###)
    1025    
     1025
    10261026    # def _p_resolveConflict(self, oldstate, committed, newstate):
    10271027    #     # Apply the changes made in going from old to newstate to
    10281028    #     # committed
    1029        
     1029
    10301030    #     # Note that in the case of undo, the olddata is the data for
    10311031    #     # the transaction being undone and newdata is the data for the
     
    10771077
    10781078    def updateCourseResults(self,student_id,level_id,portal_catalog_results,course_results): ###(
    1079         # query = Eq('path',"%s/campus/students/%s/study_course/%s" % 
     1079        # query = Eq('path',"%s/campus/students/%s/study_course/%s" %
    10801080        #            (self.portal_url.getPortalPath(),
    10811081        #             student_id,
     
    10831083        #             Eq('portal_type', "StudentCourseResult")
    10841084        # level_results = self.portal_catalog_real.evalAdvancedQuery(query)
    1085         # level_results = [r for r in course_results 
     1085        # level_results = [r for r in course_results
    10861086        #                  if level_id in r.relative_path.split('/')]
    10871087        course_results_ids = [cr.getId for cr in course_results]
     
    10951095                data[field] = getattr(course_result_doc,field,'')
    10961096            data['key'] = key = "%(student_id)s|%(level_id)s|%(course_id)s" % vars()
    1097             data['student_id'] = student_id 
    1098             data['level_id'] = level_id 
     1097            data['student_id'] = student_id
     1098            data['level_id'] = level_id
    10991099            data['queue_status'] = OBJECT_CREATED
    1100             data['code'] = course_id 
     1100            data['code'] = course_id
    11011101            self.catalog_object(dict2ob(data), uid=key)
    11021102        query = Eq('student_id',student_id) & Eq('level_id', level_id)
     
    11221122        carry_overs = []
    11231123        normal = []
    1124         credits = 0 
     1124        credits = 0
    11251125        for brain in course_results:
    11261126            d = {}
    1127             credits += int(brain.credits) 
     1127            credits += int(brain.credits)
    11281128            for field in self.schema():
    11291129                d[field] = getattr(brain,field,'')
     
    11611161        course_result.getContent().edit(mapping=d)
    11621162    ###)
    1163        
     1163
    11641164    security.declareProtected(ModifyPortalContent,"process_queue") ###(
    11651165    def process_queue(self,limit=None):
     
    12371237        #import pdb;pdb.set_trace()
    12381238        for i in xrange(num_objects):
    1239             if pghandler: 
     1239            if pghandler:
    12401240                pghandler.report(i)
    12411241            course_result_brain = course_results[i]
     
    12491249                data[field] = getattr(course_result_doc,field,'')
    12501250            data['key'] = key = "%(student_id)s|%(level_id)s|%(course_id)s" % vars()
    1251             data['student_id'] = student_id 
    1252             data['level_id'] = level_id 
     1251            data['student_id'] = student_id
     1252            data['level_id'] = level_id
    12531253            data['queue_status'] = OBJECT_CREATED
    12541254            self.catalog_object(dict2ob(data), uid=key)
  • WAeUP_SRP/trunk/Widgets.py

    r2098 r2099  
    1919from Products.WAeUP_SRP.Students import getStudentByRegNo
    2020from Products.WAeUP_SRP.Academics import makeCertificateCode
    21 from Products.ExtFile.ExtFile import ExtFile
     21#from Products.ExtFile.ExtFile import ExtFile
    2222from re import compile
    2323import logging
     
    253253    """WAeUP Session Widget."""
    254254    meta_type = 'WAeUP Session Widget'
    255    
     255
    256256    def _getSessions(self):
    257257        current_year = DateTime().year()
     
    527527                if datastructure[self.state_field]:
    528528                    v = datastructure[self.state_field] + '_' + v
    529        
     529
    530530        if self.is_required and not len(v):
    531531            datastructure.setError(widget_id, "lga required")
     
    538538            state = datastructure[self.state_field].lower()
    539539            lga = "_".join(datastructure[self.lga_field].lower().split())
    540             datamodel[self.fields[0]] =   state + "_" + lga 
     540            datamodel[self.fields[0]] =   state + "_" + lga
    541541        return 1
    542542
     
    711711        else:
    712712            mode = "edit"
    713         if not valid: 
     713        if not valid:
    714714            err = 'Invalid number'
    715715        elif self.reference == '':
     
    13211321    meta_type = "Pume Pin Widget"
    13221322    catalog = "applicants_catalog"
    1323    
     1323
    13241324    def validate(self, datastructure, **kw): ###(
    13251325        """Validate datastructure and update datamodel."""
     
    13291329        err = 0
    13301330        mapping = {}
    1331        
     1331
    13321332        prefix= self.prefix
    13331333        if prefix.startswith('@'):
     
    13891389                else:
    13901390                    applicant = datastructure['record']
    1391                     if not applicant.pin: 
     1391                    if not applicant.pin:
    13921392                        s_logger.info('%s successfully used PIN %s' % (ref,pin_str))
    13931393                        d = {}
  • WAeUP_SRP/trunk/configure.zcml

    r2094 r2099  
    66
    77  <include file="upgrade.zcml"/>
    8  
     8
    99  <adapter
    1010      factory=".exportimport.WAeUPTableXMLAdapter"
     
    1414      />
    1515
    16   <five:registerClass
    17       class=".TableDirectory.NewStudentsDirectory"
    18       meta_type="New Students Directory"
    19       permission="cmf.ManagePortal"
    20       global="False"
    21       />
     16
    2217
    2318</configure>
  • WAeUP_SRP/trunk/profiles/default/applicants_catalog.xml

    r2098 r2099  
    2727 <column value="course2"/>
    2828 <column value="course3"/>
    29  <column value="testdate"/>
     29 <column value="screening_date"/>
    3030 <column value="passport"/>
    3131 <column value="status"/>
  • WAeUP_SRP/trunk/profiles/default/layouts/application.xml

    r2098 r2099  
    156156    <property name="css_class_expr">string:row</property>
    157157  </widget>
    158   <widget name="agregate" meta_type="Int Widget">
    159     <property name="title">JAMB Agregate Score</property>
    160     <property name="fields">
    161       <element value="agregate"/>
    162     </property>
    163     <property name="label">JAMB Agregate Score</property>
    164     <property name="label_edit">JAMB Agregate Score</property>
     158  <widget name="aggregate" meta_type="Int Widget">
     159    <property name="title">JAMB Aggregate Score</property>
     160    <property name="fields">
     161      <element value="aggregate"/>
     162    </property>
     163    <property name="label">JAMB Aggregate Score</property>
     164    <property name="label_edit">JAMB Aggregate Score</property>
    165165    <property name="description"></property>
    166166    <property name="help"></property>
     
    444444    <property name="css_class_expr">string:row</property>
    445445  </widget>
    446   <widget name="testdate" meta_type="DateTime Widget">
    447     <property name="title">Test Date</property>
    448     <property name="fields">
    449       <element value="testdate"/>
    450     </property>
    451     <property name="label">Test Date</property>
    452     <property name="label_edit">Test Date</property>
     446  <widget name="screening_date" meta_type="DateTime Widget">
     447    <property name="title">Screening Date</property>
     448    <property name="fields">
     449      <element value="screening_date"/>
     450    </property>
     451    <property name="label">Screening Date</property>
     452    <property name="label_edit">Screening Date</property>
    453453    <property name="description"></property>
    454454    <property name="help"></property>
     
    593593  </row>
    594594  <row>
    595    <cell name="agregate" ncols="2"/>
     595   <cell name="aggregate" ncols="2"/>
    596596  </row>
    597597 </table>
  • WAeUP_SRP/trunk/profiles/default/schemas/application.xml

    r2095 r2099  
    1616 <field name="subj3" meta_type="CPS Int Field"/>
    1717 <field name="subj3score" meta_type="CPS Int Field"/>
    18  <field name="agregate" meta_type="CPS Int Field"/>
     18 <field name="aggregate" meta_type="CPS Int Field"/>
    1919 <field name="lastname" meta_type="CPS String Field"/>
    2020 <field name="middlenames" meta_type="CPS String Field"/>
     
    2828 <field name="sex" meta_type="CPS Boolean Field"/>
    2929 <field name="lga" meta_type="CPS String Field"/>
    30  <field name="testdate" meta_type="CPS DateTime Field"/>
     30 <field name="screening_date" meta_type="CPS DateTime Field"/>
    3131 <field name="passport" meta_type="CPS String Field"/>
    3232 <field name="status" meta_type="CPS String Field"/>
Note: See TracChangeset for help on using the changeset viewer.