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
Mallory Baskin
3,135 PointsAdded content field to Step model, now Title and Description field are listed as required
class Step(models.Model):
title = models.CharField(max_length=255)
description = models.TextField()
content = models.TextField(blank=True, default=' ')
order = models.IntegerField(default=0)
course = models.ForeignKey(Course)
Following the instructions in the video, I added the content field to my step model. I fixed the error just like Kevin did, but now when I go into the admin and try to save anything to the steps, it requires a Title and Description. I'm not sure how to turn that off. Help?
1 Answer
Chris Howell
Python Web Development Techdegree Graduate 49,703 PointsHi Mallory,
By default, the behavior of title and description they must contain a value. content on the other hand does not require a value because of the blank and default values you gave it.
However, if you are trying to mimic Kenneth in the Django Basics: Step-by-step video. Kenneth puts values in his title and description portions of his admin form when he submit. Had he not, he would of also gotten an error.
Note: Any changes you make to the Step model after you have done the makemigrations and migrate command, you will have to rerun those commands for your changes to take effect.
Chris Howell
Python Web Development Techdegree Graduate 49,703 PointsChris Howell
Python Web Development Techdegree Graduate 49,703 PointsFixed: Code snippet to use markdown styling.