Changeset 3438 for WAeUP_SRP/base
- Timestamp:
- 16 Apr 2008, 07:04:19 (17 years ago)
- Location:
- WAeUP_SRP/base
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
WAeUP_SRP/base/Academics.py
r3379 r3438 633 633 heading += '"category","study_mode","end_level","m_prefix","max_elect","max_pass",' 634 634 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"' 636 636 dataline = '"%(code)s","%(review_state)s","%(title)s","%(faculty_code)s","%(department_code)s",' 637 637 dataline += '"%(category)s","%(study_mode)s","%(end_level)s","%(m_prefix)s","%(max_elect)s","%(max_pass)s",' 638 638 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"' 640 640 export.append(heading) 641 641 #import pdb;pdb.set_trace() … … 664 664 di['promotion_credits'] = getattr(certificate_d,'promotion_credits',None) 665 665 di['start_level'] = getattr(certificate_d,'start_level',None) 666 di['application_category'] = getattr(certificate_d,'application_category',None) 666 667 di['code'] = di['code'] or certificate.id 667 668 di['review_state'] = self.portal_workflow.getInfoFor(certificate,'review_state','no_state') -
WAeUP_SRP/base/Widgets.py
r3436 r3438 787 787 self._dict = d 788 788 self._msgids = m 789 789 790 790 def __getitem__(self, key): 791 791 """Get a label for a key.""" … … 849 849 def _getVocabulary(self,datastructure=None): 850 850 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"): 855 855 application_category = screening_type 856 856 else: … … 866 866 l = [] 867 867 for k,d in self._v_certificates_docs.items(): 868 if application_category == " ALL":868 if application_category == "all": 869 869 l += (k,self._v_certificates_docs[k].title,k), 870 870 else: … … 873 873 #import ipdb;ipdb.set_trace() 874 874 return VocabularyOnTheFly(l) 875 875 876 876 InitializeClass(ApplicationCourseWidget) 877 877 -
WAeUP_SRP/base/skins/waeup_utilities/fillApplicationCategory.py
r3436 r3438 1 ## Script (Python) " ti_507_resolve"1 ## Script (Python) "fillApplicationCategory" 2 2 ##bind container=container 3 3 ##bind context=context … … 36 36 logger.info('start') 37 37 count = 0 38 not_count = 0 38 39 found = 0 39 40 commit_after = 1000 … … 41 42 certificates = context.portal_catalog.search({'meta_type': "Certificate"}) 42 43 logger.info("found %d certificates" % len(certificates)) 43 cat = {'cos': ' BASIC',44 'cos_cest': ' CEST',45 'cos_sandwich': ' SANDWICH',44 cat = {'cos': 'basic', 45 'cos_cest': 'cest', 46 'cos_sandwich': 'sandwich', 46 47 } 47 48 to_change = {} … … 59 60 logger.info("%s in %s" % (cert.id,','.join(found))) 60 61 count += 1 62 else: 63 not_count += 1 64 logger.info("%s not in vocabularies" % (cert.id,)) 61 65 for cert,d in to_change.items(): 62 66 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" % 64 68 (cert,d['application_category'])) 65 logger.info(" found %d not in vocabularies" % count)69 logger.info("%d cert codes found, %d not found in vocabularies" % (count,not_count))
Note: See TracChangeset for help on using the changeset viewer.