def delete(self, genero_id): errores = [] errores.append("Se elimino el genero correctamente") genero = Genero.eliminar(genero_id) generos = Genero.all() return render_template('generos/index.html', generos=generos, errores=errores)
def catalogo_todos(self, libros): autores = Author.all() generos = Genero.all() editoriales = Editorial.all() return render_template('libros/catalogo.html', libros=libros, autores=autores, generos=generos, editoriales=editoriales)
def new(self, errores=[], old={}): editoriales = Editorial.all() generos = Genero.all() autores = Author.all_active() return render_template('libros/agregar.html', editoriales=editoriales, generos=generos, autores=autores, errores=errores, old=old)
def edit(self, libro_id, errores=[]): libro = Libro.id(libro_id) editoriales = Editorial.all() generos = Genero.all() autores = Author.all_active() return render_template('libros/editar.html', libro=libro, editoriales=editoriales, generos=generos, autores=autores, errores=errores)
def index(self, perfil_id=None): if perfil_id != None: try: int(perfil_id) session["perfil_id"] = perfil_id except: pass libros = Libro.all() editoriales = Editorial.all() generos = Genero.all() autores = Author.all() cant = 0 mostrar = [] for libro in libros: if cant < 6: mostrar.append(libro) cant = cant + 1 return render_template('index.html', libros=mostrar, editoriales=editoriales, generos=generos, autores=autores)
def index(self): generos = Genero.all() return render_template('generos/index.html', generos=generos)