Merge lp://qastaging/~brendan-donegan/hwcert-tools/general_improvements into lp://qastaging/~hardware-certification/hwcert-tools/reporting-tools

Proposed by Brendan Donegan
Status: Merged
Approved by: Daniel Manrique
Approved revision: 127
Merged at revision: 127
Proposed branch: lp://qastaging/~brendan-donegan/hwcert-tools/general_improvements
Merge into: lp://qastaging/~hardware-certification/hwcert-tools/reporting-tools
Diff against target: 218 lines (+53/-74)
3 files modified
certification_reports/api_utils.py (+25/-0)
certification_reports/certification_report.py (+18/-55)
certification_reports/enabledvscertified.py (+10/-19)
To merge this branch: bzr merge lp://qastaging/~brendan-donegan/hwcert-tools/general_improvements
Reviewer Review Type Date Requested Status
Sylvain Pineau (community) Approve
Daniel Manrique (community) Approve
Review via email: mp+195609@code.qastaging.launchpad.net

Description of the change

This branch improves our reporting tools in the following ways:

1.) Create a module which encapsulates the batch_query function from enabledvscertified.py
2.) Use that module to shorten the code in certification_report (adding a single_query function too for another kind of query which gets just one object)
3.) Improve the batch_query code by using requests.session()

Currently only the certification_report script is improved this way. Other reports can be improved in time.

To post a comment you must log in.
Revision history for this message
Daniel Manrique (roadmr) wrote :

This is very similar to Sylvain's RESTQuerySet family of classes and to the GenericQuerySet present in checkbox-message-get-c4. I'd like to eventually have a single authoritative implementation of this stuff but for the time being this will do.

The code is greatly simplified which is good, so approving, thanks!

review: Approve
Revision history for this message
Sylvain Pineau (sylvain-pineau) wrote :

+1 for simplification. Thanks for the reuse

review: Approve

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