Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Python SQLAlchemy Basics Working with SQLAlchemy Cleaning Data

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

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.

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.