Changeset 12609 for main/waeup.kofa/trunk/src/waeup/kofa/university
- Timestamp:
- 13 Feb 2015, 06:31:37 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/university/department.py
r11891 r12609 20 20 import grok 21 21 import zope.location.location 22 from zope.event import notify 23 from zope.catalog.interfaces import ICatalog 22 24 from zope.component.interfaces import IFactory 23 25 from zope.interface import implementedBy … … 94 96 return longtitle(self) 95 97 98 def moveDepartment(self, facname, depname): 99 """ Move department to new department named depname in 100 faculty named facname. 101 102 """ 103 self.moved = True 104 fac = grok.getSite()['faculties'][facname] 105 oldcode = self.code 106 fac[depname] = self 107 del self.__parent__[oldcode] 108 fac[depname].code = depname 109 #self.__parent__._p_changed = True 110 cat = getUtility(ICatalog, name='students_catalog') 111 results = cat.searchResults(depcode=(oldcode, oldcode)) 112 for student in results: 113 notify(grok.ObjectModifiedEvent(student)) 114 student.__parent__.logger.info( 115 '%s - Department moved' % student.__name__) 116 return 117 96 118 class DepartmentFactory(grok.GlobalUtility): 97 119 """A factory for department containers.
Note: See TracChangeset for help on using the changeset viewer.