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 Using Databases in Python Meet Peewee First Queries

Martijn Bakker
Martijn Bakker
16,445 Points

the question is: Import the Challenge class from models.py. but i cant find in the video where?

I can't find the answer

queries.py

3 Answers

Bruno Junqueira
Bruno Junqueira
31,740 Points

In most of the Python challenges, the models.py is in the same directory that the code that you are going to work with.

from models import Challenge

So in that case you just need to import it the class Challenge, from models.py file.

Andrew Winkler
Andrew Winkler
37,739 Points

That make sense. Since you're already in the python shell, you should be able to omit the '.py'

Kenneth Love
STAFF
Kenneth Love
Treehouse Guest Teacher

We've used this same pattern to import things in many of the Python courses.

Hi Martijn Bakker,

the solution should be somwhere in a video before. Also the answer is almost in the question you just have to rephrase it a little bit. It will go something like:

from ... import ...

This is almost the answer. Just put the puzzle togehther and you should pass this exercise pretty quickly. However, I woul recommend you to rewatch some videos and don't try to skip through the videos. If you do, you really won't learn anything like you should especially if you have no prior expercience. GL mate