Hello,
By default, Django uses all columns as NOT NULL, and using the interactive
shell, I do the following:
e = Event(type='TYPEA')
e.save()
e.source
''
Notice, it returns an empty String, while it should return an error saying
cannot store null (since I didn't specify null). I am using Django 1.1.1
and django-pyodbc r173
Database Table:
CREATE TABLE event (
id INTEGER IDENTITY(0, 1) NOT NULL,
type VARCHAR(512) NOT NULL,
source VARCHAR(50) NOT NULL,
creation DATETIME DEFAULT getdate() NOT NULL,
PRIMARY KEY (id)
)
Django Model:
class Event(models.Model):
type = models.CharField(max_length=512)
source = models.CharField(max_length=50)
creation = models.DateTimeField('date published', auto_now=True)
def __unicode__(self):
return self.type
class Meta:
db_table = 'event'
Original issue reported on code.google.com by m0.inter...@gmail.com on 6 Jan 2010 at 5:47
Original issue reported on code.google.com by
m0.inter...@gmail.com
on 6 Jan 2010 at 5:47