import datetime

pub_date = models.DateTimeField(default=dateime.datetime.now)

——

here, datetime.datetime.now is the function

this will be repeatedly called whenever the instance is created.

But, if datetime.datetime.now() is used

it would be called once when the model is first loaded.

So, please use the function here rather than return value.

def

is to define function in Python.

—-

def  square(x):
return x*x

© 2011 Web Oom Suffusion theme by Sayontan Sinha
Switch to our mobile site
Top Footer