Merge lp://staging/~stevanr/linaro-ci-dashboard/refactor-build-list into lp://staging/linaro-ci-dashboard

Proposed by Stevan Radaković
Status: Merged
Approved by: Stevan Radaković
Approved revision: 32
Merged at revision: 30
Proposed branch: lp://staging/~stevanr/linaro-ci-dashboard/refactor-build-list
Merge into: lp://staging/linaro-ci-dashboard
Diff against target: 200 lines (+24/-88)
6 files modified
dashboard/frontend/android_build/templates/android_loop_detail.html (+3/-13)
dashboard/frontend/integration_loop/templates/integration_loop_detail.html (+3/-13)
dashboard/frontend/kernel_build/templates/kernel_loop_detail.html (+3/-13)
dashboard/frontend/models/json_response_mixin.py (+0/-43)
dashboard/frontend/templates/build.html (+3/-0)
dashboard/frontend/views/loop_build_view.py (+12/-6)
To merge this branch: bzr merge lp://staging/~stevanr/linaro-ci-dashboard/refactor-build-list
Reviewer Review Type Date Requested Status
Milo Casagrande (community) Approve
Linaro Infrastructure Pending
Review via email: mp+121438@code.staging.launchpad.net

Description of the change

Refactor build list with AJAX to use templates instead of hardcoded HTML.

To post a comment you must log in.
Revision history for this message
Milo Casagrande (milo) wrote :

Hello Stevan!

Thanks for fixing that!
Everything looks good to me, there is only one small thing that I find
a little bit disorienting (at least at first sight), but it is not
necessary:

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))
> else:
> raise NotImplementedError

Can we rename the render_to_response method in JSONResponseMixin?

--
Milo Casagrande
Infrastructure Engineer
Linaro.org <www.linaro.org> │ Open source software for ARM SoCs

Revision history for this message
Milo Casagrande (milo) wrote :

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

Revision history for this message
Milo Casagrande (milo) :
review: Approve
31. By Stevan Radaković

Removing JSON mixin class.

32. By Stevan Radaković

Fixin pep8 errors.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches