Django check to see if field is blank? -


i retrieved object database. object has foreign key field, attribute blank=true. how can check see if left blank?

thanks help!

blank=true telling admin site field can left blank.

unless set null=true well, database should complain if tried enter blank value.

if foreign key field can take null values, return none on null, check if "left blank", check if field none.

>>>   obj.foreignkeyfield none true   if not obj.foreignkeyfield:     print "this field left blank" 

Comments

Popular posts from this blog

apache - Add omitted ? to URLs -

redirect - bbPress Forum - rewrite to wwww.mysite prohibits login -

php - How can I stop spam on my custom forum/blog? -