Changeset 3438


Ignore:
Timestamp:
16 Apr 2008, 07:04:19 (17 years ago)
Author:
Henrik Bettermann
Message:

change from upper to lower case keys

fillApplicationCategory.py: improve logging

enable export and import of application_category field

remove vocabulary property from layouts

Location:
WAeUP_SRP
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • WAeUP_SRP/base/Academics.py

    r3379 r3438  
    633633        heading += '"category","study_mode","end_level","m_prefix","max_elect","max_pass",'
    634634        heading += '"n_core","nr_years","original_code","probation_credits",'
    635         heading += '"promotion_credits","start_level","admin_status"'
     635        heading += '"promotion_credits","start_level","admin_status","application_category"'
    636636        dataline = '"%(code)s","%(review_state)s","%(title)s","%(faculty_code)s","%(department_code)s",'
    637637        dataline += '"%(category)s","%(study_mode)s","%(end_level)s","%(m_prefix)s","%(max_elect)s","%(max_pass)s",'
    638638        dataline += '"%(n_core)s","%(nr_years)s","%(original_code)s","%(probation_credits)s",'
    639         dataline += '"%(promotion_credits)s","%(start_level)s","%(admin_status)s"'
     639        dataline += '"%(promotion_credits)s","%(start_level)s","%(admin_status)s","%(application_category)s"'
    640640        export.append(heading)
    641641        #import pdb;pdb.set_trace()
     
    664664                    di['promotion_credits'] = getattr(certificate_d,'promotion_credits',None)
    665665                    di['start_level'] = getattr(certificate_d,'start_level',None)
     666                    di['application_category'] = getattr(certificate_d,'application_category',None)
    666667                    di['code'] = di['code'] or certificate.id
    667668                    di['review_state'] = self.portal_workflow.getInfoFor(certificate,'review_state','no_state')
  • WAeUP_SRP/base/Widgets.py

    r3436 r3438  
    787787        self._dict = d
    788788        self._msgids = m
    789    
     789
    790790    def __getitem__(self, key):
    791791        """Get a label for a key."""
     
    849849    def _getVocabulary(self,datastructure=None):
    850850        if self.REQUEST.traverse_subpath:
    851             screening_type = self.REQUEST.traverse_subpath[0].upper()
    852         else:
    853             screening_type = 'ALL'
    854         if screening_type in ("ALL","CEST","SANDWICH"):
     851            screening_type = self.REQUEST.traverse_subpath[0].lower()
     852        else:
     853            screening_type = 'all'
     854        if screening_type in ("all","cest","sandwich"):
    855855            application_category = screening_type
    856856        else:
     
    866866        l  = []
    867867        for k,d in self._v_certificates_docs.items():
    868             if application_category == "ALL":
     868            if application_category == "all":
    869869                l  += (k,self._v_certificates_docs[k].title,k),
    870870            else:
     
    873873        #import ipdb;ipdb.set_trace()
    874874        return VocabularyOnTheFly(l)
    875                                        
     875
    876876InitializeClass(ApplicationCourseWidget)
    877877
  • WAeUP_SRP/base/skins/waeup_utilities/fillApplicationCategory.py

    r3436 r3438  
    1 ## Script (Python) "ti_507_resolve"
     1## Script (Python) "fillApplicationCategory"
    22##bind container=container
    33##bind context=context
     
    3636logger.info('start')
    3737count = 0
     38not_count = 0
    3839found = 0
    3940commit_after = 1000
     
    4142certificates = context.portal_catalog.search({'meta_type': "Certificate"})
    4243logger.info("found %d certificates" % len(certificates))
    43 cat = {'cos': 'BASIC',
    44        'cos_cest': 'CEST',
    45        'cos_sandwich': 'SANDWICH',
     44cat = {'cos': 'basic',
     45       'cos_cest': 'cest',
     46       'cos_sandwich': 'sandwich',
    4647       }
    4748to_change = {}
     
    5960        logger.info("%s in %s" % (cert.id,','.join(found)))
    6061        count += 1
     62    else:
     63        not_count += 1
     64        logger.info("%s not in vocabularies" % (cert.id,))
    6165for cert,d in to_change.items():
    6266    d['cert_doc'].edit(mapping = d)
    63     logger.info("set application_category of %s to %s" % 
     67    logger.info("set application_category of %s to %s" %
    6468               (cert,d['application_category']))
    65 logger.info("found %d not in vocabularies" % count)
     69logger.info("%d cert codes found, %d not found in vocabularies" % (count,not_count))
  • WAeUP_SRP/uniben/profiles/default/layouts/application_cest.xml

    r3436 r3438  
    474474    </property>
    475475    <property name="hidden_readonly_layout_modes"/>
    476     <property name="vocabulary">cos_cest</property>
    477476    <property name="sorted">True</property>
    478477    <property name="css_class_expr">string:row</property>
     
    495494    </property>
    496495    <property name="hidden_readonly_layout_modes"/>
    497     <property name="vocabulary">cos_cest</property>
    498496    <property name="sorted">True</property>
    499497    <property name="css_class_expr">string:row</property>
     
    517515    <property name="hidden_readonly_layout_modes"/>
    518516    <property name="sorted">True</property>
    519     <property name="vocabulary">cos_cest</property>
    520517    <property name="css_class_expr">string:row</property>
    521518  </widget>
     
    541538    <property name="hidden_readonly_layout_modes"/>
    542539    <property name="sorted">True</property>
    543     <property name="vocabulary">cos_cest</property>
    544540    <property name="css_class_expr">string:row</property>
    545541  </widget>
  • WAeUP_SRP/uniben/profiles/default/layouts/application_manage.xml

    r3436 r3438  
    646646    <property name="hidden_readonly_layout_modes"/>
    647647    <property name="sorted">True</property>
    648     <property name="vocabulary">cos_combined</property>
    649648    <property name="css_class_expr">string:row</property>
    650649  </widget>
     
    667666    <property name="hidden_readonly_layout_modes"/>
    668667    <property name="sorted">True</property>
    669     <property name="vocabulary">cos_combined</property>
    670668    <property name="css_class_expr">string:row</property>
    671669  </widget>
     
    688686    <property name="hidden_readonly_layout_modes"/>
    689687    <property name="sorted">True</property>
    690     <property name="vocabulary">cos_combined</property>
    691688    <property name="css_class_expr">string:row</property>
    692689  </widget>
     
    710707    <property name="hidden_readonly_layout_modes"/>
    711708    <property name="sorted">True</property>
    712     <property name="vocabulary">cos_combined</property>
    713709    <property name="css_class_expr">string:row</property>
    714710  </widget>
     
    730726    <property name="vocabulary">high_qual</property>
    731727  </widget>
    732  
     728
    733729  <widget name="hq_grade" meta_type="Select Widget">
    734730      <property name="title">Higher Qualification Grade</property>
     
    940936      <property name="hidden_readonly_layout_modes"/>
    941937  </widget>
    942  
     938
    943939
    944940  <widget name="aos" meta_type="Select Widget">
     
    10301026  <row>
    10311027   <cell name="passport" ncols="2"/>
    1032   </row> 
     1028  </row>
    10331029  <row>
    10341030   <cell name="aos" ncols="2"/>
    1035   </row> 
     1031  </row>
    10361032  <row>
    10371033   <cell name="course1" ncols="2"/>
     
    10431039   <cell name="course3" ncols="2"/>
    10441040  </row>
    1045      
    1046  
     1041
     1042
    10471043    <row>
    10481044      <cell name="hq_matric_no"/>
     
    10631059      <cell name="hq_disc"/>
    10641060    </row>
    1065  
     1061
    10661062    <row>
    10671063      <cell name="fst_sit_fname"/>
     
    10931089    <row>
    10941090      <cell name="scd_sit_results"/>
    1095     </row> 
    1096  
     1091    </row>
     1092
    10971093
    10981094
  • WAeUP_SRP/uniben/profiles/default/layouts/application_pce.xml

    r3436 r3438  
    6060  <property name="hidden_readonly_layout_modes"/>
    6161  <property name="css_class_expr">string:row</property>
    62   <property name="vocabulary">cos</property>
    6362 </widget>
    6463 <widget name="course2" meta_type="Application Course Widget">
     
    7574  <property name="hidden_readonly_layout_modes"/>
    7675  <property name="css_class_expr">string:row</property>
    77   <property name="vocabulary">cos</property>
    7876 </widget>
    7977 <widget name="course3" meta_type="Application Course Widget">
     
    9088  <property name="hidden_readonly_layout_modes"/>
    9189  <property name="css_class_expr">string:row</property>
    92   <property name="vocabulary">cos</property>
    9390  <property name="sorted">True</property>
    9491 </widget>
     
    110107  <property name="hidden_empty">True</property>
    111108  <property name="css_class_expr">string:row</property>
    112   <property name="vocabulary">cos</property>
    113109  <property name="sorted">True</property>
    114110 </widget>
  • WAeUP_SRP/uniben/profiles/default/layouts/application_pde.xml

    r3436 r3438  
    649649    <property name="hidden_readonly_layout_modes"/>
    650650    <property name="sorted">True</property>
    651     <property name="vocabulary">cos</property>
    652651    <property name="css_class_expr">string:row</property>
    653652  </widget>
     
    670669    <property name="hidden_readonly_layout_modes"/>
    671670    <property name="sorted">True</property>
    672     <property name="vocabulary">cos</property>
    673671    <property name="css_class_expr">string:row</property>
    674672  </widget>
     
    691689    <property name="hidden_readonly_layout_modes"/>
    692690    <property name="sorted">True</property>
    693     <property name="vocabulary">cos</property>
    694691    <property name="css_class_expr">string:row</property>
    695692  </widget>
     
    715712    <property name="hidden_empty">True</property>
    716713    <property name="sorted">True</property>
    717     <property name="vocabulary">cos</property>
    718714    <property name="css_class_expr">string:row</property>
    719715  </widget>
  • WAeUP_SRP/uniben/profiles/default/layouts/application_prence.xml

    r3436 r3438  
    595595    </property>
    596596    <property name="hidden_readonly_layout_modes"/>
    597     <property name="vocabulary">cos</property>
    598597    <property name="sorted">True</property>
    599598    <property name="css_class_expr">string:row</property>
     
    616615    </property>
    617616    <property name="hidden_readonly_layout_modes"/>
    618     <property name="vocabulary">cos</property>
    619617    <property name="sorted">True</property>
    620618    <property name="css_class_expr">string:row</property>
     
    638636    <property name="hidden_readonly_layout_modes"/>
    639637    <property name="sorted">True</property>
    640     <property name="vocabulary">cos</property>
    641638    <property name="css_class_expr">string:row</property>
    642639  </widget>
     
    662659    <property name="hidden_readonly_layout_modes"/>
    663660    <property name="sorted">True</property>
    664     <property name="vocabulary">cos</property>
    665661    <property name="css_class_expr">string:row</property>
    666662  </widget>
  • WAeUP_SRP/uniben/profiles/default/layouts/application_pume.xml

    r3436 r3438  
    567567    </property>
    568568    <property name="hidden_readonly_layout_modes"/>
    569     <property name="vocabulary">cos</property>
    570569    <property name="css_class_expr">string:row</property>
    571570  </widget>
     
    588587    </property>
    589588    <property name="hidden_readonly_layout_modes"/>
    590     <property name="vocabulary">cos</property>
    591589    <property name="css_class_expr">string:row</property>
    592590  </widget>
     
    609607    <property name="hidden_readonly_layout_modes"/>
    610608    <property name="sorted">True</property>
    611     <property name="vocabulary">cos</property>
    612609    <property name="css_class_expr">string:row</property>
    613610  </widget>
     
    634631    <property name="hidden_empty">True</property>
    635632    <property name="sorted">True</property>
    636     <property name="vocabulary">cos</property>
    637633    <property name="css_class_expr">string:row</property>
    638634  </widget>
  • WAeUP_SRP/uniben/profiles/default/layouts/application_sandwich.xml

    r3436 r3438  
    474474    </property>
    475475    <property name="hidden_readonly_layout_modes"/>
    476     <property name="vocabulary">cos_sandwich</property>
    477476    <property name="sorted">True</property>
    478477    <property name="css_class_expr">string:row</property>
     
    495494    </property>
    496495    <property name="hidden_readonly_layout_modes"/>
    497     <property name="vocabulary">cos_sandwich</property>
    498496    <property name="sorted">True</property>
    499497    <property name="css_class_expr">string:row</property>
     
    517515    <property name="hidden_readonly_layout_modes"/>
    518516    <property name="sorted">True</property>
    519     <property name="vocabulary">cos_sandwich</property>
    520517    <property name="css_class_expr">string:row</property>
    521518  </widget>
     
    541538    <property name="hidden_readonly_layout_modes"/>
    542539    <property name="sorted">True</property>
    543     <property name="vocabulary">cos_sandwich</property>
    544540    <property name="css_class_expr">string:row</property>
    545541  </widget>
     
    829825      <cell name="date_of_birth" ncols="2"/>
    830826    </row>
    831    
     827
    832828    <row>
    833829      <cell name="sex" ncols="2"/>
    834     </row>   
    835    
     830    </row>
     831
    836832     <row>
    837833      <cell name="passport" ncols="2"/>
  • WAeUP_SRP/uniben/profiles/default/layouts/import_certificate.xml

    r3333 r3438  
    160160  <property name="hidden_readonly_layout_modes"/>
    161161  <property name="vocabulary">entry_modes</property>
     162 </widget>
     163 <widget name="application_category" meta_type="Application Course Widget">
     164  <property name="title">Application Category</property>
     165  <property name="fields">
     166   <element value="application_category"/>
     167  </property>
     168  <property name="label">Application Category</property>
     169  <property name="label_edit">Application Category</property>
     170  <property name="readonly_layout_modes"/>
     171  <property name="hidden_layout_modes"/>
     172  <property name="hidden_readonly_layout_modes"/>
    162173 </widget>
    163  
     174
    164175</object>
  • WAeUP_SRP/uniben/profiles/default/schemas/import_certificate.xml

    r3333 r3438  
    1616 <field name="start_level" meta_type="CPS String Field"/>
    1717 <field name="study_mode" meta_type="CPS String Field"/>
     18 <field name="application_category" meta_type="CPS String Field"/>
    1819</object>
Note: See TracChangeset for help on using the changeset viewer.