Ticket #14558: edit.py.diff
File edit.py.diff, 1.4 KB (added by , 14 years ago) |
---|
-
edit.py
143 143 144 144 # PUT is a valid HTTP verb for creating (with a known URL) or editing an 145 145 # object, note that browsers only support POST for now. 146 put = post 146 def put(self, *args, **kwargs): 147 return self.post(*args, **kwargs) 147 148 148 149 149 150 class BaseFormView(FormMixin, ProcessFormView): … … 174 175 175 176 # PUT is a valid HTTP verb for creating (with a known URL) or editing an 176 177 # object, note that browsers only support POST for now. 177 put = post 178 def put(self, *args, **kwargs): 179 return self.post(*args, **kwargs) 178 180 179 181 class CreateView(SingleObjectTemplateResponseMixin, BaseCreateView): 180 182 """ … … 200 202 201 203 # PUT is a valid HTTP verb for creating (with a known URL) or editing an 202 204 # object, note that browsers only support POST for now. 203 put = post 205 def put(self, *args, **kwargs): 206 return self.post(*args, **kwargs) 204 207 205 208 206 209 class UpdateView(SingleObjectTemplateResponseMixin, BaseUpdateView): … … 223 226 return HttpResponseRedirect(self.get_success_url()) 224 227 225 228 # Add support for browsers which only accept GET and POST for now. 226 post = delete 229 def post(self, *args, **kwargs): 230 return self.delete(*args, **kwargs) 227 231 228 232 def get_success_url(self): 229 233 if self.success_url: