This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@has_access | |
@expose("/checkbox/<model_view>/<id_>/<attr>/<value>", methods=['GET']) | |
def checkbox(self, model_view, id_, attr, value): | |
"""endpoint for checking/unchecking any boolean in a sqla model""" | |
# "GET /caravel/checkbox/UserDBModelView/2/active/true | |
model = None | |
if model_view == 'TableColumnInlineView': | |
model = models.TableColumn | |
elif model_view == 'DruidColumnInlineView': |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from __future__ import absolute_import | |
from __future__ import division | |
from __future__ import print_function | |
from __future__ import unicode_literals | |
from sqlalchemy import ( | |
Column, Integer, String, ForeignKey, Text, Boolean, DateTime, Date, | |
Table, create_engine, MetaData, desc, select, and_, func) | |
from sqlalchemy.engine import reflection | |
from sqlalchemy.ext.declarative import declared_attr |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@has_access | |
@expose("/checkbox/<model_view>/<id_>/<attr>/<value>", methods=['GET']) | |
def checkbox(self, model_view, id_, attr, value): | |
"""endpoint for checking/unchecking any boolean in a sqla model""" | |
model = None | |
if model_view == 'TableColumnInlineView': | |
model = models.TableColumn | |
elif model_view == 'DruidColumnInlineView': | |
model = models.DruidColumn |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Full traceback: | |
"GET /caravel/checkbox/UserDBModelView/2/active/false HTTP/1.1" 500 - | |
Traceback (most recent call last): | |
File "/Users/mikhailrozhkov/Projects/pinacta/env/lib/python2.7/site-packages/Flask-0.10.1-py2.7.egg/flask/app.py", line 1836, in __call__ | |
return self.wsgi_app(environ, start_response) | |
File "/Users/mikhailrozhkov/Projects/pinacta/env/lib/python2.7/site-packages/Flask-0.10.1-py2.7.egg/flask/app.py", line 1820, in wsgi_app | |
response = self.make_response(self.handle_exception(e)) | |
File "/Users/mikhailrozhkov/Projects/pinacta/env/lib/python2.7/site-packages/Flask-0.10.1-py2.7.egg/flask/app.py", line 1403, in handle_exception | |
reraise(exc_type, exc_value, tb) | |
File "/Users/mikhailrozhkov/Projects/pinacta/env/lib/python2.7/site-packages/Flask-0.10.1-py2.7.egg/flask/app.py", line 1817, in wsgi_app |