Model object save gives Warning: Data truncated for column

2013-01-14 Thread Chen Xu
Hi Everyone, I am new to Django, I am currently converting my site from php to Django. I have already have my database (all the tables) setup when I wrote in php; now when I convert to Django, I am basically matching each column with the existing column. After I finished doing this, I try to create

Re: Model object save gives Warning: Data truncated for column

2013-01-15 Thread Bill Freeman
Does the field in question have "max_length" specified (assuming that it is a character field or a sub class)? Does introspecting the database with the database's tools indicate that the corresponding field has that size? Was the database created using Django's syncdb, or are you attempting to use

Re: Model object save gives Warning: Data truncated for column

2013-01-15 Thread Chen Xu
I am using my existing mysql db. I found out that if I have an enum and try to insert a value not present in the enum this error will occur. However, my problem occurs on a TimeField. I created this field using phpMyAdmin, it is a timestamp, and default is current time. Therefore, I did the follow

Re: Model object save gives Warning: Data truncated for column

2013-01-15 Thread Bill Freeman
Not being a MySQL expert, I'll still have a guess. The TimeField just represents the time of day, with no notion of what day, see http://docs.python.org/2.7/library/datetime.html#time-objects . The term "timestamp", on the other hand, means to me a point in time in the more grand sense, such as t

Re: Model object save gives Warning: Data truncated for column

2013-01-15 Thread Chen Xu
Yes, this sound reasonable, and I verified it. You are absolutely correct. Thanks for your help Best regards On Tue, Jan 15, 2013 at 10:25 AM, Bill Freeman wrote: > Not being a MySQL expert, I'll still have a guess. The TimeField just > represents the time of day, with no notion of what day,