﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
6189	"IntegrityError: Field ""may not be NULL"" even though blank=True"	Tyson Tate <tyson@…>	nobody	"Despite adding ""blank=True"" to my fields, I am unable to save them through the admin interface. I get errors like the following:

{{{
Environment:

Request Method: POST
Request URL: http://127.0.0.1:8000/admin/events/event/add/
Django Version: 0.97-pre-SVN-6914
Python Version: 2.4.4
Installed Applications:
['django.contrib.admin',
 'django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'django.contrib.sites',
 'django.contrib.flatpages',
 'cptri.apps.events',
 'cptri.apps.workouts',
 'cptri.apps.members']
Installed Middleware:
('django.middleware.common.CommonMiddleware',
 'django.contrib.sessions.middleware.SessionMiddleware',
 'django.contrib.auth.middleware.AuthenticationMiddleware',
 'django.middleware.doc.XViewMiddleware',
 'django.contrib.flatpages.middleware.FlatpageFallbackMiddleware')


Traceback:
File ""/opt/local/lib/python2.4/site-packages/django/core/handlers/base.py"" in get_response
  82.                 response = callback(request, *callback_args, **callback_kwargs)
File ""/opt/local/lib/python2.4/site-packages/django/contrib/admin/views/decorators.py"" in _checklogin
  56.             return view_func(request, *args, **kwargs)
File ""/opt/local/lib/python2.4/site-packages/django/views/decorators/cache.py"" in _wrapped_view_func
  39.         response = view_func(request, *args, **kwargs)
File ""/opt/local/lib/python2.4/site-packages/django/contrib/admin/views/main.py"" in add_stage
  264.             new_object = manipulator.save(new_data)
File ""/opt/local/lib/python2.4/site-packages/django/db/models/manipulators.py"" in save
  109.         new_object.save()
File ""/opt/local/lib/python2.4/site-packages/django/db/models/base.py"" in save
  261.                     ','.join(placeholders)), db_values)
File ""/opt/local/lib/python2.4/site-packages/django/db/backends/util.py"" in execute
  18.             return self.cursor.execute(sql, params)
File ""/opt/local/lib/python2.4/site-packages/django/db/backends/sqlite3/base.py"" in execute
  133.         return Database.Cursor.execute(self, query, params)

Exception Type: IntegrityError at /admin/events/event/add/
Exception Value: events_event.start_time may not be NULL
}}}

With the following model:

{{{
class Foo(models.Model):
	the_char = models.CharField(blank=True, maxlength=100)
	the_text = models.TextField(blank=True)
	the_integer = models.IntegerField(blank=True)
	
	the_time = models.TimeField(blank=True)
	the_date = models.DateField(blank=True)
	the_datetime = models.DateTimeField(blank=True)
	
	class Admin:
		pass
	
	def __str__(self):
		return ""Foo""
}}}

The following fields, if left blank, give me the above error:

{{{
the_integer
the_time
the_date
the_datetime
}}}

{{{the_char}}} does not behave unexpectedly (e.g. it allows blank values without throwing an error).

"	Uncategorized	closed	contrib.admin	dev	Normal	invalid	integrityerror, blank, null	tyson@…	Unreviewed	0	0	0	0	0	0
