Logo Search packages:      
Sourcecode: relational version File versions  Download package

def relational::relation::relation::product (   self,
  other 
)
Cartesian product, attributes must be different to avoid collisions
Doing this operation on relations with colliding attributes will 
cause the return of a None value.
It is possible to use rename on attributes and then use the product

Definition at line 123 of file relation.py.

                            :
        '''Cartesian product, attributes must be different to avoid collisions
        Doing this operation on relations with colliding attributes will 
        cause the return of a None value.
        It is possible to use rename on attributes and then use the product'''
        
        if (self.__class__!=other.__class__)or(self.header.sharedAttributes(other.header)!=0):
            return None
        newt=relation()
        newt.header=header(self.header.attributes+other.header.attributes)
        
        for i in self.content:
            for j in other.content:
                newt.content.append(i+j)
        return newt
        
    

Generated by  Doxygen 1.6.0   Back to index