Ignore:
Timestamp:
21 Dec 2011, 15:06:34 (13 years ago)
Author:
Henrik Bettermann
Message:

Update students_catalog after importing a studycourse.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.sirp/trunk/src/waeup/sirp/students/batching.py

    r7269 r7429  
    2929from zope.schema import getFields
    3030from zope.component import queryUtility
     31from zope.event import notify
    3132from zope.catalog.interfaces import ICatalog
    3233from waeup.sirp.interfaces import (
     
    244245            return None
    245246        return student.get('studycourse')
     247
     248    def updateEntry(self, obj, row, site):
     249        """Update obj to the values given in row.
     250        """
     251        for key, value in row.items():
     252            # Skip fields not declared in interface.
     253            if hasattr(obj, key):
     254                setattr(obj, key, value)
     255        # Update the students_catalog
     256        notify(grok.ObjectModifiedEvent(obj.__parent__))
     257        return
     258
Note: See TracChangeset for help on using the changeset viewer.