本文整理汇总了Python中explorer.models.Query.log方法的典型用法代码示例。如果您正苦于以下问题:Python Query.log方法的具体用法?Python Query.log怎么用?Python Query.log使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类explorer.models.Query
的用法示例。
在下文中一共展示了Query.log方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: post
# 需要导入模块: from explorer.models import Query [as 别名]
# 或者: from explorer.models.Query import log [as 别名]
def post(self, request):
sql = request.POST.get("sql", None)
if not sql:
return PlayQueryView.render(request)
query = Query(sql=sql, title="Playground")
query.log(request.user)
return self.render_with_sql(request, query)
示例2: post
# 需要导入模块: from explorer.models import Query [as 别名]
# 或者: from explorer.models.Query import log [as 别名]
def post(self, request):
sql = request.POST.get('sql')
database = request.POST.get('database')
show_results = request.POST.get('show', True)
query = Query(sql=sql, title="Playground", database=database)
query.log(request.user)
return self.render_with_sql(request, query, show_results)
示例3: post
# 需要导入模块: from explorer.models import Query [as 别名]
# 或者: from explorer.models.Query import log [as 别名]
def post(self, request, *args, **kwargs):
sql = request.POST.get('sql')
connection = request.POST.get('connection')
query = Query(sql=sql, connection=connection, title='')
ql = query.log(request.user)
query.title = 'Playground - %s' % ql.id
return _export(request, query)
示例4: post
# 需要导入模块: from explorer.models import Query [as 别名]
# 或者: from explorer.models.Query import log [as 别名]
def post(self, request):
sql = request.POST.get('sql')
query = Query(sql=sql, title="Playground")
query.log(request.user)
return self.render_with_sql(request, query)
示例5: download_from_sql
# 需要导入模块: from explorer.models import Query [as 别名]
# 或者: from explorer.models.Query import log [as 别名]
def download_from_sql(request):
sql = request.POST.get('sql')
query = Query(sql=sql, title='')
ql = query.log(request.user)
query.title = 'Playground - %s' % ql.id
return _export(request, query)
示例6: test_playground_query_log
# 需要导入模块: from explorer.models import Query [as 别名]
# 或者: from explorer.models.Query import log [as 别名]
def test_playground_query_log(self):
query = Query(sql='select 1;', title="Playground")
query.log(None)
log = QueryLog.objects.first()
self.assertTrue(log.is_playground)