aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--wqflask/wqflask/server_side.py22
-rw-r--r--wqflask/wqflask/views.py2
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)