コード例 #1
0
 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
コード例 #2
0
 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
コード例 #3
0
 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