kitchen800
kitchen800

Reputation: 227

Updating DateTimeField in Django

I have a DateTimeField() in my models.py. What I am trying to do is to update it, along with some other values in the model.

Everything else updates fine apart from my DateTimeField(). the error i get says that AttributeError: module 'datetime' has no attribute 'now'

anyone see where I am going wrong with m update?

sModel.objects.all().update(sPasses=pass_number_for_graph, sFails=fail_number_for_graph, sNds=p_number_for_graph, sTimestamp=datetime.now())

Upvotes: 0

Views: 64

Answers (1)

Surya Bista
Surya Bista

Reputation: 564

Import _datetime as instead of datetime

import _datetime

Upvotes: 1

Related Questions