Hi,

It seemed that you have run syncdb before your adding the phone_num to the 
model.

As the table is already created in the database, you may have to delete the 
table and create it again.

------------------------
Xia Kai(夏恺)
xia...@gmail.com
http://blog.xiaket.org

--------------------------------------------------
From: "chen gang" <gang.c...@nokia.com>
Sent: Friday, December 25, 2009 10:02 AM
To: <django-users@googlegroups.com>
Subject: about django model save

> Hi,
> I am really new to this tool... and need you help about this issue,
> thanks in advance!
>
> I create models.py like this,
>
> ...
> class Sms_detailed(models.Model):
>    group = models.CharField(max_length=15)
>    phone_num = models.CharField(max_length=15)
>    IMEI      = models.CharField(max_length=15)
>    sw_ver    = models.CharField(max_length=20)
>    project   = models.CharField(max_length=10)
>    sw_checksum = models.CharField(max_length=10)
>    recv_date_time = models.DateTimeField()
>    raw_data = models.CharField(max_length=30)  # raw reset data
> ...
>
> Then create the db
> [gac...@pipi autosms]$ python manage.py sql asms
> BEGIN;
> ....
> CREATE TABLE "asms_sms_detailed" (
>    "id" integer NOT NULL PRIMARY KEY,
>    "group" varchar(15) NOT NULL,
>    "phone_num" varchar(15) NOT NULL,
>    "IMEI" varchar(15) NOT NULL,
>    "sw_ver" varchar(20) NOT NULL,
>    "project" varchar(10) NOT NULL,
>    "sw_checksum" varchar(10) NOT NULL,
>    "recv_date_time" datetime NOT NULL,
>    "raw_data" varchar(30) NOT NULL
> )
> ;
> ...
> COMMIT; 

--

You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.


Reply via email to