diff options
author | uditgulati | 2020-08-23 16:13:11 -0500 |
---|---|---|
committer | uditgulati | 2020-11-01 06:47:02 -0600 |
commit | dfdff4934e423e2f4f626625a8bd1f45a64187b4 (patch) | |
tree | 28cdc0c67e1ceb202ec7578fe91e196ed2361e79 /wqflask | |
parent | 0952e43989be3f24321932c3dd33fdc697c5703a (diff) | |
download | genenetwork2-dfdff4934e423e2f4f626625a8bd1f45a64187b4.tar.gz |
update class name to ServerSideTable and add docstring
Diffstat (limited to 'wqflask')
-rw-r--r-- | wqflask/wqflask/server_side.py | 22 | ||||
-rw-r--r-- | wqflask/wqflask/views.py | 2 |
2 files changed, 22 insertions, 2 deletions
diff --git a/wqflask/wqflask/server_side.py b/wqflask/wqflask/server_side.py index 090720ec..d044d411 100644 --- a/wqflask/wqflask/server_side.py +++ b/wqflask/wqflask/server_side.py @@ -2,7 +2,27 @@ -class ServerSide(object): +class ServerSideTable(object): + ''' + This class is used to do server-side processing + on the DataTables table such as paginating, sorting, + filtering(not implemented) etc. This takes the load off + the client-side and reduces the size of data interchanged. + + Usage: + ServerSideTable(table_data, request_values) + where, + `table_data` must have data members + `rows_count` as number of rows in the table, + `table_rows` as data rows of the table, + `header_data_names` as headers names of the table. + + `request_values` must have request arguments values + including the DataTables server-side processing arguments. + + Have a look at snp_browser_table() function in + wqflask/wqflask/views.py for reference use. + ''' def __init__(self, table_data, request_values): self.request_values = request_values diff --git a/wqflask/wqflask/views.py b/wqflask/wqflask/views.py index 185517d3..f0b78188 100644 --- a/wqflask/wqflask/views.py +++ b/wqflask/wqflask/views.py @@ -922,7 +922,7 @@ def db_info_page(): def snp_browser_table(): logger.info(request.url) snp_table_data = snp_browser.SnpBrowser(request.args) - current_page = server_side.ServerSide(snp_table_data, request.args).get_page() + current_page = server_side.ServerSideTable(snp_table_data, request.args).get_page() return flask.jsonify(current_page) |