def LeerCan(self,id_art,id_al):
     cursor = DB.run("select * from Cancion where Artista_idArtista = '%s' and Album_idAlbum = '%s';" % (id_art,id_al))
     lista = []
     for b in cursor:
         Can = Cancion(b['idCancion'],b['Nombre_Cancion'],b['Artista_idArtista'],b['Album_idAlbum'])
         lista.append(Can)
     return lista
Example #2
0
    def LeerAl(self):
        cursor = DB.run("select * from Album;")
        lista = []
        for b in cursor:
            Al = Album(b['idAlbum'], b['Nombre_Album'], b['Fecha_Lanzamiento'])

            lista.append(Al)

        return lista
Example #3
0
    def LeerGen(id):
        cursor = DB.run("select * from Genero join Album_has_Genero on Album_has_Genero.Genero_idGenero = Genero.idGenero where Album_idAlbum = '%s';" % (id))
        lista = []
        for b in cursor:
            Gen = Genero(b['idGenero'], b['Nombre_Genero'])

            lista.append(Gen)

        return lista
    def LeerArt(self):
        cursor = DB.run("select * from Artista;")
        lista = []
        for b in cursor:

            Art = Artista(b['idArtista'], b['Nombre'], b['Conciertos'])

            lista.append(Art)

        return lista
    def InsertArt(self, n, c):

        DB.run("insert into Artista values (null,'%s','%s');" % (n, c))
        p = Cancion('NULL','NULL','NULL','NULL')
        id_borrar = input ("Ingrese ID a Borrar: ")
        p.BorrarCan(id_borrar)
    elif a =='12':
        p = Cancion('NULL','NULL','NULL','NULL')
        id_update = input("Ingrese ID a Actualizar: ")
        nombre_nuevo = input("Ingrese Cancion a Actualizar: ")
        p.ActualizarCan(nombre_nuevo,id_update)
    elif a =='13':
        p = Genero('NULL','NULL')
        nom_gen = input("Ingrese Genero: ")
        p.InsertGen(nom_gen)
    elif a == '14':
        id_album = input("Ingrese ID del Album: ")
        id_gen = input("Ingrese ID del Genero: ")
        DB.run("insert into Album_has_Genero values ('%s','%s')" % (id_album, id_gen))
    elif a == '15':

        id_alberto = input("Ingrese ID Album para Leer: ")
        z = Genero.LeerGen(id_alberto)
        for a in z:
            print(a.idGenero, " - ",a.Nombre_Genero)
    elif a =='16':
        p = Genero('NULL','NULL')
        id_borrar = input ("Ingrese ID a Borrar: ")
        p.BorrarGen(id_borrar)
    elif a =='17':
        p = Genero('NULL','NULL')
        id_update = input("Ingrese ID a Actualizar: ")
        nombre_nuevo = input("Ingrese Genero a Actualizar: ")
        p.ActualizarGen(nombre_nuevo,id_update)
 def ActualizarCan(self,nc,id):
     DB.run("update Cancion set Nombre_Cancion = '%s' where idCancion = '%s'; " % (nc,id))
 def BorrarCan(self,id):
     DB.run("delete from Cancion where idCancion = '%s';" % (id))
Example #9
0
 def ActualizarAl(self, n, f, id):
     DB.run(
         "update Album set Nombre_Album = '%s' , Fecha_Lanzamiento = '%s' where idAlbum = '%s'; "
         % (n, f, id))
Example #10
0
 def BorrarAl(self, id):
     DB.run("delete from Album where idAlbum = '%s';" % (id))
Example #11
0
    def InsertAl(self, n, f):

        DB.run("insert into Album values (null,'%s','%s');" % (n, f))
Example #12
0
 def ActualizarGen(self,ng,id):
     DB.run("update Genero set Nombre_Genero = '%s' where idGenero = '%s'; " % (ng,id))
Example #13
0
 def BorrarGen(self,id):
     DB.run("delete from Genero where idGenero = %s;" % (id))
Example #14
0
 def BorrarArt(self, id):
     DB.run("delete from Artista where idArtista = %s;" % (id))
Example #15
0
    def InsertCan(self,nc,id_art,id_al):

        DB.run("insert into Cancion values (null,'%s','%s','%s');" % (nc,id_art,id_al))
Example #16
0
 def ActualizarArt(self, n, c, id):
     DB.run(
         "update Artista set Nombre = '%s' , Conciertos = '%s' where idArtista = %s; "
         % (n, c, id))
Example #17
0
    def InsertGen(ng):

        DB.run("insert into Genero values (NULL,'%s');" % (ng))