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_19107_2003_spatial_schema/topology/topological_primitive/tp_solidboundary.py

    r8074 r8086  
     1 
    12 
    23 
     
    1819 
    1920''' 
    20 Created on 26-Jan-2012 16:07:38 
     21Created on 03-Feb-2012 10:41:17 
    2122 
    2223@author: mnagni 
     
    5051    @term.setter 
    5152    def term(self, value): 
    52              self._tp_primitiveboundary.term = value 
     53            self._tp_primitiveboundary.term = value 
    5354 
    5455 
     56 
     57    def __key(self): 
     58        return (self.exterior, self.term, self.interior) 
     59 
     60    def __eq__(x, y): 
     61        ''' 
     62        Cannot compare classes which do not define a "__key" attribute  
     63        ''' 
     64        if hasattr(x, '_%s__key' % (type(x).__name__)) and hasattr(y, '_%s__key' % (type(y).__name__)): 
     65            return x.__key() == y.__key() 
     66        return id(x) == id(y) 
     67 
     68    def __hash__(self): 
     69        return hash(self.__key()) 
Note: See TracChangeset for help on using the changeset viewer.