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 Django Basics Model Administration First Model

Article

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.

articles/models.py
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
Cheo R
37,150 Points

Whenever I have trouble with prompts, I like to write the prompts in the comments and iterative work through the problem using the following steps:

  1. Write the prompt has comments.
  2. Fill in what you know/can do.
  3. Find out about what you don't know.
  4. 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)

thank 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?

Cheo R
Cheo R
37,150 Points

There's this and you can always look up the python docs.