def check_status_mapping(self):
self.verbose('<STR_LIT>')<EOL>if not self.status_mapping:<EOL><INDENT>self.message('<STR_LIT>')<EOL>return<EOL><DEDENT>for old_val, new_val in self.status_mapping.iteritems():<EOL><INDENT>try:<EOL><INDENT>if isinstance(new_val, basestring):<EOL><INDENT>lookup = {'<STR_LIT>': new_val}<EOL><DEDENT>else:<EOL><INDENT>lookup = {'<STR_LIT>': new_val}<EOL><DEDENT>status = Status.objects.get(**lookup)<EOL>self.status_mapping[old_val] = status.id<EOL><DEDENT>except Status.DoesNotExist:<EOL><INDENT>raise ImproperlyConfigured('<STR_LIT>' % new_val)<EOL><DEDENT><DEDENT>self.verbose('<STR_LIT>')<EOL>
ensure status map does not contain status values which are not present in DB