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 trialGregory James
6,537 PointsArticle
I am confused as to what I am supposed to do... I feel like I am close but I don't quite understand the question.
from django.db import models
# Create your models here
class Article(models.Model):
writer = models.headline()
length = models.CharField(max_length=255)
2 Answers
Cheo R
37,150 PointsWhenever I have trouble with prompts, I like to write the prompts in the comments and iterative work through the problem using the following steps:
- Write the prompt has comments.
- Fill in what you know/can do.
- Find out about what you don't know.
- Understand how they fit together.
In this case it'd be:
from django.db import models
# Create a model named Article
# that has a headline attribute
# Article.headline
# should be a CharField with a max_length of 255.
and then just fill in as much as you can :
from django.db import models
# Create a model named Article
class Article(models.Model):
# that has a headline attribute
# Article.headline
# should be a CharField with a max_length of 255.
headline = models.CharField(max_length=255)
Cheo R
37,150 PointsThere's this and you can always look up the python docs.
Gregory James
6,537 PointsGregory James
6,537 Pointsthank you for the clarity. I still have a question. I scoured the internet to find out what a headline attribute is and how it is relevant. Can you give me that bit of information in an example that I can reference?