def ObtenerInversorPorId(self,nombre): OBase=BaseDatos(); query="SELECT * from inversor where nombre=%s "; param=(nombre) registro=OBase.Select(query,param) self._Id= int(registro[0]) self.Nombre = registro[1] self._InversionInicial = registro[2] self._Gananciatotal = registro[3] self._PorcGanancia = registro[4]
def Get(self): oBase = BaseDatos() query = "SELECT * FROM operacion where id= %s" param = (self._Id) try: registro = oBase.Select(query, param) except: print "Error in select of operation" self._IdAccion = registro[0] self._DateTime = registro[1] self._TypeOperation = registro[2] self._IdAccion = registro[3] self._Quantity = registro[6] self._Price = registro[4] self._Commission = registro[5]