Changeset 1802 for WAeUP_SRP/trunk


Ignore:
Timestamp:
21 May 2007, 14:32:59 (17 years ago)
Author:
joachim
Message:

a little code cleanup

File:
1 edited

Legend:

Unmodified
Added
Removed
  • WAeUP_SRP/trunk/Students.py

    r1801 r1802  
    215215    ###)
    216216
    217 
    218217    security.declareProtected(ModifyPortalContent,"createStudents")###(
    219218    def createStudents(self):
    220         """load Studentdata from CSV values"""
     219        """
     220        load addmitted Studentdata from CSV values and create Studentobjects.
     221        This is the current method to create new addmitted Students.
     222        Before running the eventservice for the students_catalog must be disabled.
     223        """
    221224        import transaction
    222225        import random
    223226        #from pdb import set_trace
    224227        wftool = self.portal_workflow
    225         students_folder = self.portal_catalog({'meta_type': 'StudentsFolder'})[-1].getObject()
     228        #students_folder = self.portal_catalog({'meta_type': 'StudentsFolder'})[-1].getObject()
     229        students_folder = self.portal_url.getPortalObject().campus.students
    226230        #entry_levels = {'ume_ft':'100',
    227231        #                'de_ft': '200',
     
    395399            #import pdb;pdb.set_trace()
    396400            self.students_catalog.addRecord(**catalog_entry)
    397             if tr_count > 10:
     401            if tr_count > 1000:
    398402                if len(no_import) > 0:
    399403                    open("%s/import/%s_not_imported.csv" % (i_home,name),"a").write(
     
    418422        wftool = self.portal_workflow
    419423        current = DateTime.DateTime().strftime("%d-%m-%y_%H_%M_%S")
    420         students_folder = self.portal_catalog({'meta_type': 'StudentsFolder'})[-1].getObject()
    421         #students_folder = self.portal_url().getPortalObject().campus.students
     424        #students_folder = self.portal_catalog({'meta_type': 'StudentsFolder'})[-1].getObject()
     425        students_folder = self.portal_url.getPortalObject().campus.students
    422426        tr_count = 1
    423427        total = 0
     
    500504    ###)
    501505
    502 
    503506    security.declareProtected(ModifyPortalContent,"fixAllNames")###(
    504507    def fixAllNames(self):
     
    600603    ###)
    601604
    602 
    603 
    604605    security.declareProtected(ModifyPortalContent,"updateReturningStudents")###(
    605606    def updateReturningStudents(self):
     
    610611        wftool = self.portal_workflow
    611612        current = DateTime.DateTime().strftime("%d-%m-%y_%H_%M_%S")
    612         students_folder = self.portal_catalog({'meta_type': 'StudentsFolder'})[-1].getObject()
     613        #students_folder = self.portal_catalog({'meta_type': 'StudentsFolder'})[-1].getObject()
     614        students_folder = self.portal_url.getPortalObject().campus.students
    613615        tr_count = 1
    614616        total = 0
     
    704706        wftool = self.portal_workflow
    705707        current = DateTime.DateTime().strftime("%d-%m-%y_%H_%M_%S")
    706         students_folder = self.portal_catalog({'meta_type': 'StudentsFolder'})[-1].getObject()
     708        #students_folder = self.portal_catalog({'meta_type': 'StudentsFolder'})[-1].getObject()
     709        students_folder = self.portal_url.getPortalObject().campus.students
    707710        tr_count = 1
    708711        total = 0
     
    793796    ###)
    794797
    795 
    796798    security.declareProtected(ModifyPortalContent,"updateStudyCourse")###(
    797799    def updateStudyCourse(self):
     
    801803        from pdb import set_trace
    802804        wftool = self.portal_workflow
    803         students_folder = self.portal_catalog({'meta_type': 'StudentsFolder'})[-1].getObject()
     805        #students_folder = self.portal_catalog({'meta_type': 'StudentsFolder'})[-1].getObject()
     806        students_folder = self.portal_url.getPortalObject().campus.students
    804807        csv_d = {'jamb_reg_no': "RegNumber",
    805808                 'jamb_lastname': "Name",
Note: See TracChangeset for help on using the changeset viewer.