예제 #1
0
파일: iso.py 프로젝트: helixyte/TheLMA
    def update(self, data):
        if not IEntity.providedBy(data): # pylint: disable=E1101
            prx = DataElementAttributeProxy(data)
            try:
                new_owner = prx.owner
            except AttributeError:
                pass
            else:
                if new_owner != self.owner:
#                current_owner = None if self.owner == '' else self.owner
                    self.__process_change_owner(new_owner)
            try:
                new_delivery_date = prx.delivery_date
            except AttributeError:
                pass
            else:
                self.delivery_date = new_delivery_date
            try:
                jobs = prx.jobs
            except AttributeError:
                pass
            else:
                self.__process_iso_jobs(jobs)
            try:
                isos = prx.isos
            except AttributeError:
                pass
            else:
                self.__process_isos(isos)
예제 #2
0
파일: session.py 프로젝트: helixyte/everest
 def update(self, entity_class, data, target=None):
     if not IEntity.providedBy(data): # pylint: disable=E1101
         upd_ent = self.__run_traversal(entity_class, data, target,
                                        RELATION_OPERATIONS.UPDATE)
     else:
         upd_ent = SaSession.merge(self, data)
     return upd_ent
예제 #3
0
 def make_relationship(self, relator, direction=RELATIONSHIP_DIRECTIONS.BIDIRECTIONAL):
     """
     Create a relationship object for this attribute from the given
     relator and relationship direction.
     """
     if IEntity.providedBy(relator):  # pylint:disable=E1101
         rel = DomainRelationship(relator, self, direction=direction)
     elif IResource.providedBy(relator):  # pylint:disable=E1101
         rel = ResourceRelationship(relator, self, direction=direction)
     else:
         raise ValueError(
             'Invalid relator argument "%s" for ' "relationship; must provide IEntity or " "IResource." % relator
         )
     return rel
예제 #4
0
 def make_relationship(self,
                       relator,
                       direction=RELATIONSHIP_DIRECTIONS.BIDIRECTIONAL):
     """
     Create a relationship object for this attribute from the given
     relator and relationship direction.
     """
     if IEntity.providedBy(relator):  # pylint:disable=E1101
         rel = DomainRelationship(relator, self, direction=direction)
     elif IResource.providedBy(relator):  # pylint:disable=E1101
         rel = ResourceRelationship(relator, self, direction=direction)
     else:
         raise ValueError('Invalid relator argument "%s" for '
                          'relationship; must provide IEntity or '
                          'IResource.' % relator)
     return rel
예제 #5
0
파일: session.py 프로젝트: papagr/everest
 def remove(self, entity_class, data):
     if not IEntity.providedBy(data): # pylint: disable=E1101
         self.__run_traversal(entity_class, None, data,
                              RELATION_OPERATIONS.REMOVE)
     else:
         SaSession.delete(self, data)
예제 #6
0
파일: session.py 프로젝트: papagr/everest
 def add(self, entity_class, data): # different signature pylint: disable=W0222
     if not IEntity.providedBy(data): # pylint: disable=E1101
         self.__run_traversal(entity_class, data, None,
                              RELATION_OPERATIONS.ADD)
     else:
         SaSession.add(self, data)
예제 #7
0
 def update(self, data):
     if IEntity.providedBy(data): # pylint: disable=E1101
         self.get_entity().molecule_designs = data.molecule_designs
     else:
         Member.update(self, data)