Changeset 2632
- Timestamp:
- 12 Nov 2007, 17:23:46 (17 years ago)
- Location:
- WAeUP_SRP
- Files:
-
- 2 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
WAeUP_SRP/base/WAeUPTables.py
r2627 r2632 90 90 ###) 91 91 92 def record2dict(self,fields,record): 92 def record2dict(self,fields,record): ###( 93 93 d = {} 94 94 for key in fields: … … 109 109 d[key] = '' 110 110 return d 111 112 ###) 111 113 112 114 def addRecord(self, **data): ###( … … 602 604 # "course_admitted", 603 605 # ) 606 ###) 607 604 608 def __init__(self,name=None): 605 609 if name == None: 606 610 name = self.name 607 611 WAeUPTable.__init__(self, name) 608 609 610 612 611 613 security.declareProtected(ModifyPortalContent,"new_importCSV")###( … … 722 724 logger.info("invalid mode: %s" % mode) 723 725 logger.info("%(mode)sed %(imported)d records, invalid written to %(not_imported_fn)s" % d) 724 ###)726 ###) 725 727 726 728 InitializeClass(ApplicantsCatalog) -
WAeUP_SRP/base/WAeUPTool.py
r2580 r2632 304 304 repository = getToolByName(self, 'portal_repository') 305 305 pxtool = getToolByName(self, 'portal_proxies') 306 logger.info('start') 306 307 pxtool_infos = pxtool.getRevisionsUsed() 308 logger.info('found %d used revisions ' % (len(pxtool_infos))) 307 309 308 310 nb_revs = 0 … … 310 312 unused_docids_d = {} # all docids that are unused 311 313 ids_unused_revs_docids = [] # ids for revs of unused docids 312 ids_unused_revs = [] # ids for unused revs314 unused_ids = [] # ids for unused revs 313 315 total = 0 314 316 idlist = repository.objectIds() 317 to_delete = 0 318 found = False 315 319 for id in idlist: 316 320 docid, rev = repository._splitId(id) … … 319 323 continue 320 324 nb_revs += 1 321 docids_d[docid] = None322 325 if not pxtool_infos.has_key(docid): 323 unused_docids_d[docid] = None324 ids_unused_revs_docids.append(id)325 ids_unused_revs.append(id)326 found = True 327 to_delete += 1 328 unused_ids.append(id) 326 329 elif not pxtool_infos[docid].has_key(rev): 327 ids_unused_revs.append(id) 328 if len(ids_unused_revs) >= max: 329 repository.manage_delObjects(ids_unused_revs) 330 found = True 331 to_delete += 1 332 unused_ids.append(id) 333 if found and not to_delete % max: 334 found = False 330 335 #import pdb;pdb.set_trace() 336 repository.manage_delObjects(unused_ids) 331 337 transaction.commit() 332 total += max 333 logger.info('removed %d total %d unused docids ' % (max,total)) 334 anz = len(ids_unused_revs) 335 if anz > 0: 336 repository.manage_delObjects(ids_unused_revs) 337 transaction.commit() 338 total += anz 339 logger.info('finished removing %d unused docids ' % (total)) 338 logger.info('removed %d total %d unused docids ' % (max,to_delete)) 339 else: 340 if unused_ids: 341 repository.manage_delObjects(unused_ids) 342 transaction.commit() 343 logger.info('finished removing %d unused docids ' % (to_delete)) 340 344 341 345 -
WAeUP_SRP/base/Widgets.py
r2604 r2632 276 276 if len(v) == 1: 277 277 v = value = '0%c' % v 278 elif len(v) == 9: 279 v = value[2:4] 278 280 elif not value: 279 281 v = value = self.getSessionId()[0] 280 282 #import pdb;pdb.set_trace() 281 283 sessions = self._getSessions() 282 if not sessions.has_key(v alue):284 if not sessions.has_key(v): 283 285 datastructure.setError(widget_id, "'%s' not a valid session key" % v) 284 286 return 0 -
WAeUP_SRP/base/skins/waeup_student/study_course_view.pt
r2490 r2632 31 31 <tr> 32 32 <td width="220px">Current Study Level:</td> 33 <td><span tal:content="python:context.portal_vocabularies. levels.get(info['doc'].current_level)" /></td>33 <td><span tal:content="python:context.portal_vocabularies.student_levels.get(info['doc'].current_level)" /></td> 34 34 </tr> 35 35 <tr> -
WAeUP_SRP/uniben/profiles/default/layouts/student_study_course.xml
r2474 r2632 59 59 <property name="hidden_layout_modes"/> 60 60 <property name="hidden_readonly_layout_modes"/> 61 <property name="vocabulary"> levels</property>61 <property name="vocabulary">student_levels</property> 62 62 </widget> 63 63 <widget name="current_mode" meta_type="Select Widget"> -
WAeUP_SRP/uniben/profiles/default/vocabularies.xml
r2457 r2632 6 6 <object name="acco_hall_reserved_rooms" meta_type="CPS Method Vocabulary"/> 7 7 <object name="levels" meta_type="CPS Vocabulary"/> 8 <object name="student_levels" meta_type="CPS Method Vocabulary"/> 8 9 <object name="csv_names" meta_type="CPS Method Vocabulary"/> 9 10 <object name="entry_modes" meta_type="CPS Vocabulary"/>
Note: See TracChangeset for help on using the changeset viewer.