Hi Pradip, On Tue, Feb 4, 2014 at 5:18 PM, Pradip Caulagi <ppc.li...@gmail.com> wrote:
> I am using the following (simplified) model that doesn't migrate using the > new migrations in Django 1.7a1 - > > ... > File "/tmp/bar/blog/migrations/0001_initial.py", line 17 > ('created', models.DateTimeField(default=datetime.datetime(2014, 2, > 4, 9, 15, 59, 685251, tzinfo=<UTC>))), > > ^ > SyntaxError: invalid syntax > $ > $ > > What am I missing? I know that we can have use auto_now for the > DateTimeField but I want the value to be shown populated with current > datetime that can be overridden by the user, if they want. > A Django migration file is just a Python file. The error you're seeing is a Python error - the code you've entered, at line 17, at the point where the caret is pointing, isn't valid syntax. Specifically - "tzinfo=<UTC>" isn't legal Python. This is the 0001_initial migration - did you manually write or update this migration, or is this code entirely automatically generated? If it's manually written or edited, then fix what you wrote :-) If it's the result of automated output, then it appears you've found a bug. I'm guessing it's a problem with the serialisation of datetimes as defaults. If you can open a ticket describing the model that caused the problem, that would be very helpful. Yours, Russ Magee %-) -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To post to this group, send email to django-users@googlegroups.com. Visit this group at http://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAJxq849oRZqFUnbr48fTLOO_CfOZn3vXGj23%2B66E0TWuu1KZ9g%40mail.gmail.com. For more options, visit https://groups.google.com/groups/opt_out.