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 Django ORM Basic ORM Usage Exclusivity

Brendan Whiting
.a{fill-rule:evenodd;}techdegree seal-36
Brendan Whiting
Front End Web Development Techdegree Graduate 84,704 Points

Nothing happens when I click on the 'Search' button.

When I click on the 'Search' button with 'text' (as he does at 4:20), nothing happens for me, no results. I compared all my text to the downloaded text from the project files, and they're the same. I even flew the project files into a workspace and tried it out and I got the same error. I'm stumped.

Chris Freeman
Chris Freeman
Treehouse Moderator 68,082 Points

Can you snapshot your workspace and post the link to the snapshot?

2 Answers

Chris Freeman
Chris Freeman
Treehouse Moderator 68,082 Points

The search text "text" does not seem to have any results. Blank results are still results. Try searching for "basics" or "java". This returned results.

If in doubt, you can always enter the interactive shell and check for data:

$ ./manage.py shell 
Python 3.5.0 (default, Mar 14 2016, 21:57:24) 
[GCC 4.8.5 20150623 (Red Hat 4.8.5-4)] on linux 
Type "help", "copyright", "credits" or "license" for more information InteractiveConsole)
>>> from courses.models import Course 
>>> Course.objects.filter(description__icontains='text') 
>>> Course.objects.filter(description__icontains='basics') 
[<Course: Python Basics>, <Course: Customizing Django Templates>, <Course: Build a Simple Android App>, <Course: SQL Basics>, <Course: jQuery Basics>]

Might be misunderstanding you, but try changing the coding of the <button> from <button type="button"> as Kenneth has in the video to <button type="submit"> and your button should work (as long as everything else works too!)

Cheers, Owen