SQL: create index on `dt_insert` in table `xmlrpc_xmlrpclog` and add upgrade&downgrade sql.

[TCMS-242] Ticket for adding index on `dt_insert` field in `xmlrpc_xmlrpclog` table.

Add two migration DDL sql for v3.8.8 to upgrade and downgrade nitrate DB.

Merge v3.8.7hotfix DDL to nitrate_db_setup.sql

Change-Id: I0b1bb8b39994818194b6c93b15d3d1ee04c427f0
REV: format code style in xmlrpc module

1. Delete unused import
2. Delete unused variables
3. Sort import
4. Insert new line among methods.
5. Do not around = in keyword parameters.
6. Auto wrap line with 80 characters.

Change-Id: If3a8a65916042182cf6971e57b860caeae44b991
FIX: bugfix 1091914

Bug 1091914 - [xmlrpc]Use TestRun.filter_count to filter testrun, the satistics result is wrong in the following case.

1. Adjust import statement, class statement, method statement by PEP8
2. Replace filter_count impl with dictinct_count
3. Modify TestCase, TestPlan, TestRun to_xmlrpc method, using distinct_filter to generate QuerySet.

Change-Id: I410e1cc4199164f0decf7789a6e58fef2ec8718d
REV: xmlrpc error handling

[TCMS-306] XMLRPC error handling.

1. Auto load decorators and wrap xmlrpc api.
2. Using raise errors instead of return.
3. For django form validation, save errors as list and sent to client.

Change-Id: I01e00831037507609c186b7e762f00be9f33efb8
FIX: TCMS-297

TCMS-297 - [Slow Query] fix sql query that queries test cases

Affected features:

- print cases in plan page
- create new run in plan page
- remove case(s) from a plan

The first two changes only affect page loading.
The last one affects the complete delete operation.

Change-Id: I7d78b61ee78551dda4e82cd6314aadc0105e196d
FIX: missing user's email when display a case' comments in plan plage

TCMS-308 - Missing user's email when display a case' comments in plan page

Change-Id: I3ffce6d0df1cc94070885cde8c58423b40fae6be
FIX: missing user's email in advanced search result page

Missing user's email when display a case' comments in advanced search result
page. This patch is related to issue

TCMS-308 - Missing user's email when display a case' comments in plan page

Change-Id: Ife0e120c144ebe7f279b39d761e2e81eeb8c1d38
REV: fix import error when startup tcms.

Make a mistake when merging code.

Change-Id: Iaaa3903425be4af5f05962bdafaf7ae6c30db2fb
FIX: bug 1099379

Bug 1099379 - [test run]User can not remove cases in assigncase page while
system show tips: uncheck checkbox to remove from the test run.

Change-Id: Iad510ae690d7b4d622b9e06d2908502b437c07d2
REV: optimize assign cases page loading and update

TCMS-232 - [Performance] speed up loading /run/${run_id}/assigncase and update

Enlarge the scope of the performance improvement. Not only optimize the page
loading, but also the assignment process. Because the original implementation
of View method mixes the two process together. It is not possible to make
changes to page loading only.

Change-Id: I5a95fb0322807383c5f1499b1eeff87eba918912
FIX: cannot create new run involved by prev commit 575fe69

Change-Id: I4ed5dbdd7bde21f2095a755c966f444281b3cc4b
FIX: bugfix 1099367

Bug 1099367 - [xmlrpc]system will return 500 error when invoking TestPlan.filter in the following case.

Change-Id: I85a3819f9599df4dff07598e34fa710c02ac6928
FIX: bugfix 1099416

Bug 1099416 - [xmlrpc]When invoke Product.get_environments which system did not implement, system will return 400 error not 501 error.

Change-Id: I2369646b1942115eb98d45f7d3a3e54c19aaf4f7
FIX: bugfix 1099433

Bug 1099433 - [xmlrpc]system can not update build's status 'is_active' from True to False via build.update method.

Change-Id: Ida3c3773ac38b8106eca056bb731fc1111d4221c
FIX: TCMS-212

The order of Params(case_id,run_id) for TestCaseRun.get_bugs_s is wrong.

Change-Id: Ifa532b1b4fd57350c8441322ba5441c6f21923ad
FIX: optimize slow query within TestRun.get_test_cases

Change-Id: Ib7238ccae4899308daacc982ad31551b93d6c42a
REV: bump release to 3.8.7-5

Change-Id: Iefb41a65317b19ad4e67e6069bf98e9b71970359
FIX: bugfix 1092444, 1091932

Bug 1092444 - [xmlrpc]If a caserun has more than 2 test log links, invoke TestCaseRun.filter, system only return the first link_id for test log.

Bug 1091932 - [xmlrpc]Use TestPlan.update to update 'env_group' for 2 plans at one tiome, the 'env_group' of returned value for first plan is null.

Using list to save groupby values if we need it later.

Change-Id: I5f07b09a3a9d7673529bd817f91c67727b711a76
REV: refactor xmlrpc log_call

Add customized log creation method used in dev
Using functools.wraps instead of manual

Change-Id: I61d1b51078793c90411a4ee24b6e59330d6adadf
REV: bump to release 3.8.7-6

ready to release to production

Change-Id: Id80ce1daa90683939ea1c01f7ee7f7f7d3d35780