Retrieving the results from a table using SQLAlchemy
How can I print the results returned by session.query(User.name).filter(User.gender != 'male')
This will return all the male candidates in the table. I want to print name of each candidate seperately. Do I need to include a for loop for this?
>>> for instance in session.query(User).order_by(User.id): ... print instance.name, instance.fullname ed Ed Jones wendy Wendy Williams mary Mary Contrary fred Fred Flinstone