[pypy-dev] Django DateField default value and migrations fail
Sergey Kurdakov
sergey.forum at gmail.com
Wed Aug 17 06:15:39 EDT 2016
Hi Yury,
thanks for lambda tip,
ok I will submit a ticket to Django, will see how it goes.
Regards
Sergey
On Wed, Aug 17, 2016 at 12:53 PM, Yury V. Zaytsev <yury at shurup.com> wrote:
> 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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/pypy-dev/attachments/20160817/e8aab75d/attachment.html>
More information about the pypy-dev
mailing list