﻿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
189	Inline editing of foreign keys doesn't do pretty error handling.	Nick Stenning	Adrian Holovaty	"When adding/editing foreign keys in the admin interface, any violation of NOT NULL or other schema specifications will throw a traceback rather than a pretty ""this is what you did wrong"" explanation when adding foreign keys manually.

{{{
There's been an error:

Traceback (most recent call last):

  File ""/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/django/core/handlers/base.py"", line 63, in get_response
    return callback(request, **param_dict)

  File ""/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/django/views/admin/main.py"", line 860, in change_stage
    new_object = manipulator.save(new_data)

  File ""/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/django/core/meta.py"", line 87, in _curried
    return args[0](*(args[1:]+moreargs), **dict(kwargs.items() + morekwargs.items()))

  File ""/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/django/core/meta.py"", line 1479, in manipulator_save
    new_rel_obj.save()

  File ""/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/django/core/meta.py"", line 87, in _curried
    return args[0](*(args[1:]+moreargs), **dict(kwargs.items() + morekwargs.items()))

  File ""/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/django/core/meta.py"", line 765, in method_save
    (opts.db_table, ','.join(field_names), ','.join(placeholders)), db_values)

  File ""/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/django/core/db/base.py"", line 10, in execute
    result = self.cursor.execute(sql, params)

IntegrityError: ERROR:  null value in column ""votes"" violates not-null constraint

INSERT INTO polls_choices (poll_id,choice,votes) VALUES ('1','This is making me hungry ;-)',NULL)
}}}
"	defect	closed	contrib.admin		normal	fixed	admin interface error handling schema null fields		Ready for checkin	0	0	0	0	0	0
