Changeset 1722 for WAeUP_SRP/trunk


Ignore:
Timestamp:
28 Apr 2007, 11:20:09 (18 years ago)
Author:
joachim
Message:

modify also data on add

File:
1 edited

Legend:

Unmodified
Added
Removed
  • WAeUP_SRP/trunk/WAeUPTables.py

    r1716 r1722  
    703703        if pt != 'Course':
    704704            return
    705         #from pdb import set_trace;set_trace()
    706705        data = {}
    707706        rpl = infos['rpath'].split('/')
     
    711710        data[self.key] = course_id
    712711        if event_type == "sys_add_object":
     712            doc = object.getContent()
     713            #from pdb import set_trace;set_trace()
     714            for field in self.schema():
     715                if field != self.key:
     716                    data[field] = getattr(doc,field,None)
    713717            try:
    714718                self.addRecord(**data)
     
    719723        if event_type == "sys_modify_object" and mt == 'Course':
    720724            for field in self.schema():
    721                 data[field] = getattr(object,field,None)
     725                if field != self.key:
     726                    data[field] = getattr(object,field,None)
    722727            course_id = object.aq_parent.getId()
    723728            data[self.key] = course_id
Note: See TracChangeset for help on using the changeset viewer.