Changes between Initial Version and Version 1 of Ticket #27081
- Timestamp:
- Aug 17, 2016, 9:56:35 PM (8 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #27081 – Description
initial v1 4 4 5 5 from datetime import date 6 6 {{{ 7 #!python 7 8 class TestClass(models.Model): 8 9 … … 11 12 default=date.today, 12 13 ) 13 14 }}} 14 15 pypy migrations will fail 15 16 16 django/db/migrations/writer.py", line 540, in serialize 17 "topics/migrations/#migration-serializing" % (value, get_docs_version()) 17 django/db/migrations/writer.py", line 540, in serialize "topics/migrations/#migration-serializing" % (value, get_docs_version()) 18 18 ValueError: Cannot serialize: <bound method type.today of <class 'datetime.date'>> 19 19 … … 26 26 27 27 a solution for client code is to declare local function 28 {{{ 29 #!python 28 30 29 31 def today(): 30 32 return date.today() 31 33 32 but would be better to add types.MethodType check for pypy compatibility 34 33 35 class TestClass(models.Model): 34 36 … … 37 39 default=today, 38 40 ) 41 }}} 42 43 but would be better to add types.MethodType check for pypy compatibility