'Adds an error to the form\'s error dictionary.
It can be used after validation based on problems reported via the API.
This is useful when you wish for API errors to appear as errors on the
form rather than using the messages framework.'

def api_error(self, message):

    self.add_error(NON_FIELD_ERRORS, message)
