On Mon, Aug 27, 2012 at 5:30 PM, Milo Casagrande <email address hidden> wrote: > > On Mon, Aug 27, 2012 at 5:17 PM, Stevan Radaković > <email address hidden> wrote: >> >> from django.contrib.auth.decorators import login_required >> +from django.shortcuts import render_to_response >> +from django.template import RequestContext >> from django.views.generic.detail import DetailView >> >> def render_to_response(self, context): >> if self.request.is_ajax(): >> - build = self.object.schedule_build() >> - return JSONResponseMixin.render_to_response(self, build) >> + data = { >> + "build" : self.object.schedule_build() >> + } >> + template = "build.html" >> + return render_to_response(template, data, context_instance = RequestContext(self.request))
Forgot to say: at least cut down under 80 chars that line. :-)
-- Milo Casagrande Infrastructure Engineer Linaro.org <www.linaro.org> │ Open source software for ARM SoCs
« Back to merge proposal
On Mon, Aug 27, 2012 at 5:30 PM, Milo Casagrande contrib. auth.decorators import login_required views.generic. detail import DetailView to_response( self, context): is_ajax( ): schedule_ build() in.render_ to_response( self, build) schedule_ build() to_response( template, data, context_instance = RequestContext( self.request) )
<email address hidden> wrote:
>
> On Mon, Aug 27, 2012 at 5:17 PM, Stevan Radaković
> <email address hidden> wrote:
>>
>> from django.
>> +from django.shortcuts import render_to_response
>> +from django.template import RequestContext
>> from django.
>>
>> def render_
>> if self.request.
>> - build = self.object.
>> - return JSONResponseMix
>> + data = {
>> + "build" : self.object.
>> + }
>> + template = "build.html"
>> + return render_
Forgot to say: at least cut down under 80 chars that line. :-)
--
Milo Casagrande
Infrastructure Engineer
Linaro.org <www.linaro.org> │ Open source software for ARM SoCs