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 trialTravis Spencer
4,639 PointsDjango Basics - Challenge Task 2 of 3 - DateTimeField
I am confused as to what I am missing in regards to this question. I have created another attribute, publish_date, with a DateTimeField with no arguments. Can someone please advise what step I am missing.
Thanks!
from django.db import models
# Create your models here
class Article(models.Model):
headline = models.CharField(max_length=255)
publish_date = models.DateTimeField()
3 Answers
Jeff Muday
Treehouse Moderator 28,720 PointsYour code looks fine to me (pretty much identical to mine)-- I redid the challenge and paste what passed for me.
from django.db import models
# Create your models here
class Article(models.Model):
headline = models.CharField(max_length=255)
publish_date = models.DateTimeField()
content = models.TextField()
Travis Spencer
4,639 PointsThanks, Jeff! It worked. I appreciate your help.
Anna Muravyeva
12,162 Pointswas stuck on the same bug but the snippet worked, thanks!
Jonathan Fernatt
4,335 PointsIt looks like the code in the challenge is double tabbed. Fixing that resolved the issue for me.
Travis Spencer
4,639 PointsTravis Spencer
4,639 PointsHere is the actual task instructions: Now add another field to the Article model named publish_date. It should be a DateTimeField and have no arguments.