﻿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
4728	ForeignKey that is blank and null should not return DoesNotExist err if null	bo@…	Adrian Holovaty	"
{{{
#Best by example 

#A simple self refed model
class Message(models.Model):
   blurb = models.TextField()
   replied_message = models.ForeignKey('self', blank = True, null = True, default = None)

#Grab a row
r = Messages.objects.get(pk = 1)
#now if i ask the question
if not r.replied_message:
   #do something
else:
  #do something else




}}}
this will toss a DoesNotExist exception even-though it is perfectly acceptable to have this field be None
granted a try: except: would solve it, but that seems strange given the rules of blank and null  
if this is a feature please ignore my post"		closed	Core (Other)	dev		invalid	ForeignKey blank null DoesNotExist		Unreviewed	0	0	0	0	0	0
