python - django convert datetimefield to datefield with mysql backend -


for django app, want convert datetimefield datefield. resulting in error :

 date truncation column ...  

can please tell me how ?

i have tried this:

i have written datamigration before schemamigration modifies values of datetimefield datetime date .

  obj.datetimefield = obj.datetimefield.date()   obj.save()   --- error here. 

how expect work without schemamigration?

you add field model, then run code copy old field new field after modification(s). then can delete old field , finally rename new field.

but honestly, should have @ south, excellent , common used tool migrating django models.


Comments

Popular posts from this blog

php - mySql Join with 4 tables -

css - Text drops down with smaller window -

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -