Пример #1
0
    def load( self ):
        r = Database.executeRow('''
                select 
                    created_by, 
                    description, 
                    notes,
                    source_name, 
                    sup_id, 
                    stp_id, 
                    creation_time, 
                    completed_time, 
                    uploaded_time,
                    status,
                    upl_id
                from 
                    elc_GetJobDetails(%s)
                ''', self._id )
        if not r:
            raise Error("Invalid job id " + str(self._id) + " requested")

        self._created_by = r[0]
        self._description = r[1] or ''
        self._notes = r[2] or ''
        self._source_name = r[3] or ''
        self._sup_id = r[4]
        self._stp_id = r[5]
        self._creation_time = r[6]
        self._completed_time = r[7]
        self._uploaded_time = r[8]
        self._status = r[9] or 'UNKN'
        self._upl_id = r[10]
Пример #2
0
 def __init__( self, id ):
     r = Database.executeRow('select created_by, creation_time, filename, n_insert, n_delete from elc_GetUploadDetails(%s)',id)
     self._id = id
     self._created_by = r[0]
     self._creation_time = r[1]
     self._filename = r[2]
     self._n_insert = r[3]
     self._n_delete = r[4]
Пример #3
0
 def __init__( self, id ):
     self._id = id
     stp_id, stt_id, name = Database.executeRow('select stp_id, stt_id, name from elc_GetSupplier(%s)', id )
     self._stp_id = stp_id
     self._stt_id = stt_id
     self._name = name
Пример #4
0
    def load( self ):
        r = Database.executeRow('''
            select
                job_id,
                roadname,
                housenumber,
                src_id,
                src_roadname,
                src_housenumber,
                sad_roadname,
                sad_housenumber,
                status,
                notes,
                rna_id,
                rcl_id,
                sad_id,
                sad_par_id,
                sad_offset,
                par_id,
                par_sad_count,
                merge_adr_id,
                ismerged,
                warning_codes,
                cluster_id,
                src_status,
                src_comment,
                range_low,
                range_high,
                location
            from
                elc_GetAddressDetails(%s)
            ''',
            self._id)
        if not r:
            self._deleted = True
            return
        if r[0] != self._job.id():
            raise Error("Invalid address id "+str(self._id)+" - does not belong to job " + str(self._job.id()))

        self._roadname = r[1]
        self._housenumber = r[2]
        self._src_id = r[3]
        self._src_roadname = r[4]
        self._src_housenumber = r[5]
        sad_roadname = r[6]
        sad_housenumber = r[7]
        self._status = r[8]
        self._notes = r[9]
        self._rna_id = r[10]
        self._rcl_id = r[11]
        self._sad_id = r[12]
        self._sad_par_id = r[13]
        sad_offset = r[14]
        self._par_id = r[15]
        self._par_sad_count = r[16]
        self._merge_adr_id = r[17]
        self._ismerged = r[18]
        self._warning_codes = r[19]
        self._cluster_id = r[20]
        self._src_status = r[21]
        self._src_comment = r[22]
        self._range_low = r[23]
        self._range_high = r[24]

        # Sort out linked address
        self._sad_address = ''
        self._sad_offset = 0.0
        if self._sad_id:
            self._sad_address = sad_housenumber + ' ' + sad_roadname
            self._sad_offset = round(sad_offset,1)

        # Pull out a number for sorting...
        self._number = 0
        match = re.match(r"\d+",self._housenumber)
        if match:
            self._number = int(match.group(0))

        # Pull out coordinates
        location = []
        if r[25] is not None:
            match = re.match(r"POINT\((\-?\d+\.?\d*)\s+(\-?\d+\.?\d*)\)",r[25])
            if match:
                location = [float(match.group(1)),float(match.group(2))]
        self._location = location