Changeset 7471


Ignore:
Timestamp:
09/09/10 16:23:50 (9 years ago)
Author:
sdonegan
Message:

Put in bugfix to deal with neoddas records with no dif creation date (this dws to be upgraded soon)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • TI01-discovery-Ingest/trunk/v3n_NDG3/ingestAutomation-upgrade/OAIBatch/PostgresDAO.py

    r5846 r7471  
    66import sys, os, logging 
    77from SpatioTemporalData import * 
     8import datetime,time 
    89from ndg.common.src.clients.reldb.postgres.postgresclient import PostgresClient as pgc 
    910 
     
    289290        ''' 
    290291        logging.info("Inserting new original document in Postgres DB") 
     292         
     293        #fudge for neoddas records     
     294        if len(self._record.dataset_lastEdit) == 0: 
     295                logging.warn("Dataset record has no edit date listed!  Fudging with current date") 
     296                self._record.dataset_lastEdit = str(datetime.datetime.now())     
     297         
     298         
    291299        sqlCmd = "SELECT create_document('" + self._record.shortFilename + "', '" + \ 
    292300            self._record.discovery_id + "', '" + self._record.docType + "', '" + \ 
     
    294302            self._record.getParametersInfo() + "', '" + self._record.getScopeInfo() + "', '" + \ 
    295303            self._record.dataset_name + "', '" + self._record.datacentre_name + "', '" + self._record.dataset_lastEdit + "', '" + self._record.datasetStartNom + "', '" + self._record.datasetEndNom + "');" 
    296                      
     304         
    297305         
    298306        sqlCmd = sqlCmd.replace("'NULL'","NULL") 
Note: See TracChangeset for help on using the changeset viewer.