Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

Python SQLAlchemy Basics Working with SQLAlchemy Cleaning Data

Sean Timmons
seal-mask
.a{fill-rule:evenodd;}techdegree
Sean Timmons
Data Analysis Techdegree Student 4,126 Points

App returns memory location for Book Object, instead of string containing book info.

When checking the output for the app.py file my project returns the memory location for the book objects instead of, what appears to be, a string like in the instructors video.

I've tried calling "dict" on the book object which is slightly closer to the desired result but is a lot less readable than what appeared in the video. Just looking for some clarification on why my output was so different then what appeared at the end of the video.

There is another question that asks this as well but there was no answer given that really addresses what is going on here since I followed the video step-by-step in this instance.

2 Answers

Sean Timmons
seal-mask
.a{fill-rule:evenodd;}techdegree
Sean Timmons
Data Analysis Techdegree Student 4,126 Points

I'm going to assume this is either some sort of difference between windows/mac/the shells we are using or maybe I missed something small leading up to this point in the tutorial that is creating this difference. But after testing my objects all of the data seems to be in place after iterating through the list of books and checking all data points so I'll just carry on.

If anyone feels like illuminating me as to what may be happening though ill gladly take the input.

Sean Timmons
seal-mask
.a{fill-rule:evenodd;}techdegree
Sean Timmons
Data Analysis Techdegree Student 4,126 Points

After reviewing the code I think this has something to do with the dunder repr in models.py since that is where the formatting takes place. I am not sure why im getting a memory location instead of the string repr is supposed to spit out.