I am trying to apply a query to a table, using the ORM sqlalchemy in a database already created with mysql, with the following code:
eng = create_engine("mysql+mysqldb://host='localhost', user='root', passwd='...',port='3307', database='Nomina_jul15'")
Session = sessionmaker (bind=eng)
session = Session()
def Ver():
print("Estas en la Opcion Ver Empleados ")
print("")
print("idEmpleados \t numdocEmp \t nombreEmp \t salbasicEmp \t fechaingEmp \t nombre_eps \t nombre_afp \t fechanacEmp \t sexoEmp")
print("============================================================================================================================")
for Empleados in session:
empleados = session.query(Empleados).get(Empleados)
print(str(empleados))
session.close()
print('')
And I only get the header of the report:
Estas en la Opcion Ver Empleados
idEmpleados numdocEmp nombreEmp salbasicEmp fechaingEmp nombre_eps nombre_afp fechanacEmp sexoEmp
============================================================================================================================
I do not know if it's because I did not do the creation of the database using SQLAlchemy.