You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
i am using django-datatables-view for displaying data in the Datatable. When i try to use this plugin with tables i got output as i needed.I have a procedure in MySQL. How can i use procedures in data tables in django.
in models.py
from django.db import connections
class MY_UTIL:
def log_message(self):
cur = connections["stats"].cursor()
cur.callproc("USP_RPT_TOP_MOS",('2018-11-05',0))
results = cur.fetchall()
cur.close()
return results
in views.py:
class OrderJson(BaseDatatableView):
columns = ['Client','Operator','Circle','OA','DA','Message','SubmitTime']
order_columns = ['Client','Operator','Circle','OA','DA','Message','SubmitTime']
def get_initial_queryset(self):
my_util = MY_UTIL()
ret = my_util.log_message()
return ret
def render_column(self, row, column):
return super(OrderJson, self).render_column(row, column)
when i try to do this its returning the following error TypeError: count() takes exactly one argument (0 given).procedure returns tuple here.
The text was updated successfully, but these errors were encountered:
i am using django-datatables-view for displaying data in the Datatable. When i try to use this plugin with tables i got output as i needed.I have a procedure in MySQL. How can i use procedures in data tables in django.
in models.py
in views.py:
when i try to do this its returning the following error TypeError: count() takes exactly one argument (0 given).procedure returns tuple here.
The text was updated successfully, but these errors were encountered: