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/geometry/coordinate_geometry/gm_conic.py

    r8074 r8086  
     1 
    12 
    23 
     
    1819 
    1920''' 
    20 Created on 26-Jan-2012 16:07:29 
     21Created on 03-Feb-2012 10:41:13 
    2122 
    2223@author: mnagni 
     
    3839 
    3940        self.startConstrParam = None 
     41        self.numDerivativesAtEnd = None 
    4042        self.curve = None 
    41         self.numDerivativesAtEnd = None 
    4243        self.interpolation = None 
    4344        self.numDerivativesAtStart = None 
     
    5354 
    5455    @property 
     56    def numDerivativesAtEnd(self): 
     57        return self._gm_curvesegment.numDerivativesAtEnd 
     58 
     59    @numDerivativesAtEnd.setter 
     60    def numDerivativesAtEnd(self, value): 
     61            self._gm_curvesegment.numDerivativesAtEnd = value 
     62 
     63    @property 
    5564    def curve(self): 
    5665        return self._gm_curvesegment.curve 
     
    5867    @curve.setter 
    5968    def curve(self, value): 
    60              self._gm_curvesegment.curve = value 
    61  
    62     @property 
    63     def numDerivativesAtEnd(self): 
    64         return self._gm_curvesegment.numDerivativesAtEnd 
    65  
    66     @numDerivativesAtEnd.setter 
    67     def numDerivativesAtEnd(self, value): 
    68              self._gm_curvesegment.numDerivativesAtEnd = value 
     69            self._gm_curvesegment.curve = value 
    6970 
    7071    @property 
     
    7475    @interpolation.setter 
    7576    def interpolation(self, value): 
    76              self._gm_curvesegment.interpolation = value 
     77            self._gm_curvesegment.interpolation = value 
    7778 
    7879    @property 
     
    8283    @numDerivativesAtStart.setter 
    8384    def numDerivativesAtStart(self, value): 
    84              self._gm_curvesegment.numDerivativesAtStart = value 
     85            self._gm_curvesegment.numDerivativesAtStart = value 
    8586 
    8687 
     
    9293    @numDerivativeInterior.setter 
    9394    def numDerivativeInterior(self, value): 
    94              self._gm_curvesegment.numDerivativeInterior = value 
     95            self._gm_curvesegment.numDerivativeInterior = value 
    9596 
    9697 
     
    101102 
    102103 
     104 
     105    def __key(self): 
     106        return (self.startConstrParam, self.numDerivativesAtEnd, self.curve, self.interpolation, self.numDerivativesAtStart, self.endConstrParam, self.numDerivativeInterior, self.shifted, self.position, self.semiLatusRectum, self.eccentricity) 
     107 
     108    def __eq__(x, y): 
     109        ''' 
     110        Cannot compare classes which do not define a "__key" attribute  
     111        ''' 
     112        if hasattr(x, '_%s__key' % (type(x).__name__)) and hasattr(y, '_%s__key' % (type(y).__name__)): 
     113            return x.__key() == y.__key() 
     114        return id(x) == id(y) 
     115 
     116    def __hash__(self): 
     117        return hash(self.__key()) 
Note: See TracChangeset for help on using the changeset viewer.