带信号的Django CreateView?

时间:2012-12-23 03:39:04

标签: django django-class-based-views mixing

我有几个使用CreateView的模型:

class JsonResponseMixin(object):

    def is_valid(self, form):
        ...
        return HttpResponse(json.dumps(data))
    ...

class CarCreate(JsonResponseMixin, CreateView):
    model = Car
    form = CarForm
    success_url = '/success'

我的问题是如何在Django CreateView中发送car_create.send()信号?

1 个答案:

答案 0 :(得分:0)

我创建了一个自定义CreateViewform_valid发送了该信号。