本文整理匯總了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)