def GetByUserId(id): sql = "SELECT * FROM EVENTO WHERE usuarioId=?" cursor.execute(sql, id) eventos = [] for row in cursor.fetchall(): evento = Evento(row[0], row[1], row[2], row[3], row[4], row[5]) eventos.append(evento) return eventos
def GetAll(): sql = "SELECT * FROM EVENTO" cursor.execute(sql) eventos = [] for row in cursor.fetchall(): evento = Evento(row[0], row[1], row[2], row[3], row[4], row[5]) eventos.append(evento) return eventos
def Update(json): result = False try: evento = Evento(json['id'], json['imagenUrl'], json['titulo'], json['descripcion'], json['tiempo'], json['usuarioId']) result = EventoRepository.Update(evento) except: result = False return result