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!
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
I can't solve this quiz
I can't solve this quiz and I don't know where the problem
from django.http import HttpResponse from .models import Article # Write your views here def article_list(request): Articles= Article.objects.all() output=join(Articles) out=len(output) return HttpResponse("There are" + out + "articles")
Chris FreemanTreehouse Moderator 68,404 Points
You have the correct idea. There are items to clean up:
- There isn't a built-in
joincommand. And if there was, it's not necessary since you can get the count (length) of a queryset directly using
- When concatenating strings, all parts must be strings. So the
outshould be wrapped using
- Punctuation matters! Notice there should be a period at the sentence end and there should be a space before and after the article count value.
Not an syntax error, but it is not a good practice to reuse object names such as
Article as variable names. It can make the code less readable if it's not obvious that
Article no longer represents the imported object
Article. Additionally, you loose access to the imported object
Article once the name is reused locally.
Post back if you need more help. Good luck!!