Changeset 173 for waeup_product/trunk/Extensions
- Timestamp:
- 15 Nov 2005, 16:28:29 (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
waeup_product/trunk/Extensions/install.py
r170 r173 210 210 'visible' : 1, 211 211 }, 212 ## { 'tool' : 'portal_actions', 212 ## { 'tool' : 'portal_actions', ###( 213 213 ## 'id' : 'add_jamb', 214 214 ## 'name' : 'Add Student JAMB', … … 264 264 ## 'visible' : 1, 265 265 ## }, 266 ###) 267 266 268 ) 269 self.deleteActions({'portal_actions': [action['id'] for action in actions]}) 267 270 self.verifyActions(actions) 268 271 ########################################## … … 403 406 returned.append(portlet_id) 404 407 return returned 405 406 ###) 408 ###) 407 409 408 410 def installCustomWorkflows(self): ###( … … 448 450 se_chains, 449 451 destructive=1) 450 451 ###) 452 ###) 453 454 def verifyFaculties(self, academics): ###( 455 """install Universityspecific Faculies with Departments""" 456 faculties = [ 457 ## {'id': 'agri', ###( 458 ## 'Title': 'Agriculture', 459 ## 'departments': [ 460 ## { 'id': 'dep1', ###( 461 ## 'Title': 'One', 462 ## }, 463 ## ], 464 ## },###) 465 { 'id': 'science', 466 'Title': 'Science', 467 'departments': [ 468 { 'id': 'bio', ###( 469 'Title': 'Biochemistry', 470 }, 471 { 'id': 'bot', 472 'Title': 'Botany', 473 }, 474 { 'id': 'che', 475 'Title': 'Chemistry', 476 }, 477 { 'id': 'com', 478 'Title': 'Computer Science', 479 }, 480 { 'id': 'geo', 481 'Title': 'Geologie', 482 }, 483 { 'id': 'mat', 484 'Title': 'Mathematics', 485 }, 486 { 'id': 'mic', 487 'Title': 'Microbiology', 488 }, 489 { 'id': 'opt', 490 'Title': 'Optometry', 491 }, 492 { 'id': 'phy', 493 'Title': 'Physics', 494 }, 495 { 'id': 'zoo', 496 'Title': 'Zoology', 497 }, 498 ], 499 },###) 500 ]###) 501 self.log('Verifying Faculties in %s' % academics.absolute_url(relative=1)) 502 for faculty in faculties: 503 fid = faculty['id'] 504 f = getattr(academics,fid,None) 505 self.log('Checking Faculty %(id)s = %(Title)s' % faculty) 506 if f is None: 507 self.log('Creating Faculty %(id)s = %(Title)s' % faculty) 508 academics.invokeFactory('Faculty', fid) 509 f = getattr(academics,fid) 510 f.getContent().edit(mapping=faculty) 511 for department in faculty['departments']: 512 self.log('Checking Department %(id)s = %(Title)s' % department) 513 did = department['id'] 514 d = getattr(f,did,None) 515 if d is None: 516 self.log('Creating Department %(id)s = %(Title)s' % department) 517 f.invokeFactory('Department', did) 518 d = getattr(f,did) 519 d.getContent().edit(mapping=department) 520 ###) 521 452 522 453 523 … … 492 562 accommodation = getattr(waeup,'accommodation').getContent() 493 563 accommodation.edit(mapping={'Title':'Accommodation'}) 494 if not hasattr(waeup,'academics'): 564 academics = getattr(waeup,'academics',None) 565 if academics is None: 495 566 waeup.invokeFactory('AcademicsFolder','academics') 496 academics = getattr(waeup,'academics').getContent() 497 academics.edit(mapping={'Title':'Academics'}) 567 academics = getattr(waeup,'academics') 568 academics.getContent().edit(mapping={'Title':'Academics'}) 569 installer.verifyFaculties(academics) 498 570 if not hasattr(waeup,'accommodation'): 499 571 waeup.invokeFactory('AccoFolder','accommodation')
Note: See TracChangeset for help on using the changeset viewer.