On Wed, 17 Aug 2016, Sergey Kurdakov wrote:

class TestClass(models.Model):

    start_date = models.DateField(
        verbose_name=u'start date',
        default=today,
        )

so I just wrap required function call into function.

You can, of course, use a lambda, i.e. `default=lambda: date.today()` which is to the same effect, but a bit shorter.

But this is a temporary solution. Would be great if there could be a general one.

So does it work if you modify Django as William suggested? If yes, it sounds like this is better fixed in Django...

--
Sincerely yours,
Yury V. Zaytsev
_______________________________________________
pypy-dev mailing list
pypy-dev@python.org
https://mail.python.org/mailman/listinfo/pypy-dev

Reply via email to