Ignore:
Timestamp:
03/02/12 13:48:25 (8 years ago)
Author:
mnagni
Message:

Fixed the multiple CI_Party INSERT in the DB
Refactored the ingestion thanks to the new eq method in the imported classes DB library

File:
1 edited

Legend:

Unmodified
Added
Removed
  • mauRepo/MolesManager/trunk/src/ea_model/iso_19129_2009_igcd/igcd_framework/if_tincoverage.py

    r8074 r8086  
     1 
    12 
    23 
     
    1819 
    1920''' 
    20 Created on 26-Jan-2012 16:07:35 
     21Created on 03-Feb-2012 10:41:12 
    2122 
    2223@author: mnagni 
     
    3940        self.domainExtent = [] 
    4041        self.interpolationType = None 
     42        self.geometry = None 
    4143        self.commonPointRule = None 
    42         self.geometry = None 
    4344        self.rangeType = None 
    4445        self.interpolationParametersType = None 
     
    5657 
    5758 
     59 
     60    def __key(self): 
     61        return (self.domainExtent, self.interpolationType, self.geometry, self.commonPointRule, self.rangeType, self.interpolationParametersType) 
     62 
     63    def __eq__(x, y): 
     64        ''' 
     65        Cannot compare classes which do not define a "__key" attribute  
     66        ''' 
     67        if hasattr(x, '_%s__key' % (type(x).__name__)) and hasattr(y, '_%s__key' % (type(y).__name__)): 
     68            return x.__key() == y.__key() 
     69        return id(x) == id(y) 
     70 
     71    def __hash__(self): 
     72        return hash(self.__key()) 
Note: See TracChangeset for help on using the changeset viewer.