def setIcon(self, personId, metaDataId): ''' @see: IPersonIconService.setIcon ''' entityDb = PersonIconMapped() entityDb.Id, entityDb.MetaData = personId, metaDataId try: self.session().merge(entityDb) self.session().flush((entityDb,)) except SQLAlchemyError as e: handle(e, entityDb) return entityDb.Id
def setIcon(self, personId, metaDataId, update): ''' @see: IPersonIconService.setIcon ''' if update: user = User() user.Id = personId self.userService.update(user) entityDb = PersonIconMapped() entityDb.Id, entityDb.MetaData = personId, metaDataId try: self.session().merge(entityDb) self.session().flush((entityDb,)) except SQLAlchemyError as e: handle(e, entityDb) return entityDb.Id