Ignore:
Timestamp:
04/07/12 12:28:21 (9 years ago)
Author:
mnagni
Message:

Two main new features:
1) the migration generate a report. The report is sent by mail to the subscribers defined in the settings.py
2) require to display a missing observation adds a message on the page and hides the some fields in the html form
3) a new javascript library (commons.js)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • mauRepo/MolesManager/trunk/src/libs/migration/tests/migrationprocess.py

    r8391 r8433  
    4444from libs.migration.InfodbEPB import InfodbEPBFactory 
    4545from MolesManager.settings import EVENTS_DB 
    46 from libs.migration.client import EPBRepo 
     46from libs.migration.client import EPBRepo, generateMigrationReport 
     47from django.core.mail import send_mail 
    4748 
    4849class LoadResourceTest(TestCase): 
     
    9091         
    9192        #IASI 
    92         #self.processDataEntity(DO_NEODC, DS_pUBLISHED, 'dataent_12417810458627666.atom') 
    93         #self.processDataEntity(DO_BADC, DS_pUBLISHED, 'dataent_VIRTEM.atom') 
    94         #self.processDataEntity(DO_BADC, DS_pUBLISHED, 'dataent_12162569915925921.atom') 
     93        self.processDataEntity(DO_NEODC, DS_pUBLISHED, 'dataent_12417810458627666.atom') 
     94        self.processDataEntity(DO_BADC, DS_pUBLISHED, 'dataent_VIRTEM.atom') 
     95        self.processDataEntity(DO_BADC, DS_pUBLISHED, 'dataent_12162569915925921.atom') 
    9596               
    9697        #ECMWF 
    97         #self.processDataEntity(DO_BADC, DS_pUBLISHED, 'dataent_ECMWF-ERA.atom') 
    98         #self.processDataEntity(DO_BADC, DS_pUBLISHED, 'dataent_ECMWF-OP.atom') 
    99         #self.processDataEntity(DO_BADC, DS_pUBLISHED, 'dataent_12458543158227759.atom')                 
    100         #self.processDataEntity(DO_BADC, DS_pUBLISHED, 'dataent_ECMWF-E40.atom') 
    101         #self.processDataEntity(DO_BADC, DS_pUBLISHED, 'dataent_ECMWF-TRJ.atom')                 
     98        self.processDataEntity(DO_BADC, DS_pUBLISHED, 'dataent_ECMWF-ERA.atom') 
     99        self.processDataEntity(DO_BADC, DS_pUBLISHED, 'dataent_ECMWF-OP.atom') 
     100        self.processDataEntity(DO_BADC, DS_pUBLISHED, 'dataent_12458543158227759.atom')                 
     101        self.processDataEntity(DO_BADC, DS_pUBLISHED, 'dataent_ECMWF-E40.atom') 
     102        self.processDataEntity(DO_BADC, DS_pUBLISHED, 'dataent_ECMWF-TRJ.atom') 
     103         
     104         
     105        self.processDataEntity(DO_NEODC, DS_pUBLISHED, 'dataent_11750994700119761.atom') 
     106        self.processDataEntity(DO_BADC, DS_pUBLISHED, 'dataent_ECMWF-TRJ.atom') 
     107        self.processDataEntity(DO_BADC, DS_pUBLISHED, 'dataent_UGAMPO3.atom') 
     108        self.processDataEntity(DO_BADC, DS_pUBLISHED, 'dataent_12282368470627062.atom')                         
     109         
     110        #self.processDataEntity()               
    102111 
    103112         
    104     def processDataEntity(self, doc_owner, doc_status, doc_name): 
    105         dataEntity = MigrationObject() 
    106         dataEntity.doc_owner = doc_owner         
    107         dataEntity.doc_status = doc_status 
    108         dataEntity.doc_name = doc_name 
     113    def processDataEntity(self, doc_owner = None, doc_status = None, doc_name = None): 
     114        dataEntity = None 
     115        if doc_owner is not None and doc_status is not None and doc_name is not None: 
     116            dataEntity = MigrationObject() 
     117            dataEntity.doc_owner = doc_owner         
     118            dataEntity.doc_status = doc_status 
     119            dataEntity.doc_name = doc_name 
    109120        ex = self.mp.process(dataEntity) 
    110         for e in ex: 
    111             print e 
    112          
     121        generateMigrationReport(ex) 
    113122 
Note: See TracChangeset for help on using the changeset viewer.