Re: Getting the last modified datetime from a DateTimeField

141 views
Skip to first unread message
Message has been deleted

Jesus Noland

unread,
Jun 7, 2012, 2:14:08 AM6/7/12
to django...@googlegroups.com
Thank you for your reply.

Ok so if I type out:

m = Model.objects.get(id=1)

then

m.date

Will give me the date and time of the last time it was saved? Because that is not what I am seeing. I am seeing the date the model was first created.

On Tuesday, June 5, 2012 12:33:36 PM UTC-7, Jesus Noland wrote:
Hello everyone,

I am using Django 1.3 on Python 2.7 and I have a field in a model setup like this:

date = models.DateTimeField(auto_now=True, auto_now_add=True)

now I would like to know how to get the last modified date from this field if my model
is called 'm':

m.date.last_modified ???

Your help is greatly appreciated. Thank you.

Derek

unread,
Jun 7, 2012, 2:43:20 AM6/7/12
to Django users
Message has been deleted

Jesus Noland

unread,
Jun 21, 2012, 5:35:02 PM6/21/12
to django...@googlegroups.com
Thank you very much. I am understand now. Sorry it took so long to reply back.

Jesus Noland

unread,
Jun 21, 2012, 5:36:37 PM6/21/12
to django...@googlegroups.com
I was always getting the date when the model was last modified when using 'm.date'
Reply all
Reply to author
Forward
0 new messages