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_19103_2005_schema_language/basic_types/implementation/collections/bag.py

    r8074 r8086  
     1 
    12 
    23 
     
    1819 
    1920''' 
    20 Created on 26-Jan-2012 16:07:40 
     21Created on 03-Feb-2012 10:41:13 
    2122 
    2223@author: mnagni 
     
    4142 
    4243 
     44 
     45    def __key(self): 
     46        return (self.element) 
     47 
     48    def __eq__(x, y): 
     49        ''' 
     50        Cannot compare classes which do not define a "__key" attribute  
     51        ''' 
     52        if hasattr(x, '_%s__key' % (type(x).__name__)) and hasattr(y, '_%s__key' % (type(y).__name__)): 
     53            return x.__key() == y.__key() 
     54        return id(x) == id(y) 
     55 
     56    def __hash__(self): 
     57        return hash(self.__key()) 
Note: See TracChangeset for help on using the changeset viewer.