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

jQuery clickable div with working mailto link inside -

java - Getting corefrences with Standard corenlp package -

WPF: binding viewmodel property of type DateTime to Calendar inside ItemsControl -