I'm toying around in django
trying to understand its philosophy, and I tried to create a last modified entry. I place this in my code:
slide_title = models.CharField(max_length=200)
last_date = models.DateTimeField('last modified',auto_now=True)
def __str__(self):
out = 'title: {}\n last modified: {}'.format(
self.slide_title,
type(self.last_date)
)
return out
But when I start a shell
(using python manage.py shell
) I get the following
In [2]: from pressent.models import Slide
In [3]: Slide.objects.all()
Out[3]:
[<Slide: title: title
last modified: <type 'NoneType'>>]
Why isn't it a DateTimeField?