'"Add an option to the autocomplete list.
If \'text\' is not defined in POST or self.create(text) fails, raises
bad request. Raises ImproperlyConfigured if self.create if not defined.'

def post(self, request):

    if (not hasattr(self, 'create')):
        raise ImproperlyConfigured('Missing    "create()"')
    text = request.POST.get('text', None)
    if (text is None):
        return http.HttpResponseBadRequest()
    text = self.create(text)
    if (text is None):
        return http.HttpResponseBadRequest()
    return http.HttpResponse(json.dumps({'id': text, 'text': text}))
