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 trialCristy Lucke
Courses Plus Student 3,040 PointsAdding publish_date as DateTimeField fails, but failure message too vague to figure out what I did wrong
I added the publish_date field as seen in the code, but the failure message just says "Bummer: Try again!" Not very helpful at all!
The question says to add a DateTimeField called publish_date with no arguments. I can't figure out any other syntax based on what we've done in the course so far. I thought the syntax was:
<name> = models.<data type>(<arguments>)
Can anyone understand what this test is looking for that is different than what I have?
from django.db import models
# Create your models here
class Article(models.Model):
headline = models.CharField(max_length=255)
publish_date = models.DateTimeField()
1 Answer
Jonathan Fernatt
4,335 PointsI came across this post looking for an answer to the same problem. I'm sure you're far past this issue now but I found that the code is double tabbed which is causing it to fail. Hope it helps someone else.