I have the following model.
from django.db import models
class Client(models.Model):
postcode = models.CharField(max_length=10)
first_name = models.CharField(max_length=100)
last_name = models.CharField(max_length=100)
address = models.TextField(blank=True)
phone = models.IntegerField(blank=True)
email = models.EmailField(blank=True)
url = models.URLField(blank=True)
client_since = models.DateTimeField('Client Since')
def __unicode__(self):
return self.first_name
def client_since(self):
return self.client_since.date() == datetime.date.today()
class Contractor(models.Model):
postcode = models.CharField(max_length=10)
first_name = models.CharField(max_length=100)
last_name = models.CharField(max_length=100)
address = models.TextField(blank=True)
phone = models.IntegerField(blank=True)
email = models.EmailField(blank=True)
contractor_since = models.DateTimeField('Contractor Since')
def __unicode__(self):
return self.first_name
def contractor_since(self):
return self.contractor_since.date() == datetime.date.today()
I run 'python manage.py validate' gives me - 0 errors found
Then I run 'python manage.py sql "appname" and I get to see my tables...
BEGIN;
CREATE TABLE "schedule_client" (
"id" integer NOT NULL PRIMARY KEY,
"postcode" varchar(10) NOT NULL,
"first_name" varchar(100) NOT NULL,
"last_name" varchar(100) NOT NULL,
"address" text NOT NULL,
"phone" integer NOT NULL,
"email" varchar(75) NOT NULL,
"url" varchar(200) NOT NULL,
"client_since" datetime NOT NULL
)
;
CREATE TABLE "schedule_contractor" (
"id" integer NOT NULL PRIMARY KEY,
"postcode" varchar(10) NOT NULL,
"first_name" varchar(100) NOT NULL,
"last_name" varchar(100) NOT NULL,
"address" text NOT NULL,
"phone" integer NOT NULL,
"email" varchar(75) NOT NULL
)
;
COMMIT;
But I don't see "contracor_since in the contractor table ... db field being created??? I tried several times, I am using django 1.1.1 on OS X leopard.
What I am doing wrong?