This template uses the following variables in it's context:
+ search_path The requested search_path
sql Text of the sql command(s)
result_rows List of SQLResult objects
</%doc>
cur
'''
sql_results = attrs.field(factory=list)
+ search_path = attrs.field(default=None)
def make_form(self):
return pgwui_sql.views.base.SQLForm().build(
self, ip=pgwui_sql.views.base.SQLInitialPost(),
fc=pgwui_sql.views.base.SQLWTForm)
+ def read(self):
+ super().read()
+ self.search_path = self.request.POST.get('search_path')
+
def write(self, result, errors):
'''
Setup dict to render resulting html form
report_success Boolean. Whether the copy succeeded.
'''
response = super().write(result, errors)
+ response['search_path'] = self.search_path
response['report_success'] = (not response['errors']
and self.uf['action'] != '')
return response