kopia lustrzana https://github.com/simonw/datasette
rodzic
481eb96d85
commit
a3e6f1b167
|
@ -45,7 +45,8 @@
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if not hide_sql %}
|
{% if not hide_sql %}
|
||||||
{% if editable and allow_execute_sql %}
|
{% if editable and allow_execute_sql %}
|
||||||
<p><textarea id="sql-editor" name="sql">{% if query and query.sql %}{{ query.sql }}{% else %}select * from {{ tables[0].name|escape_sqlite }}{% endif %}</textarea></p>
|
<p><textarea id="sql-editor" name="sql"{% if query and query.sql %} style="height: {{ query.sql.split("\n")|length + 2 }}em"{% endif %}
|
||||||
|
>{% if query and query.sql %}{{ query.sql }}{% else %}select * from {{ tables[0].name|escape_sqlite }}{% endif %}</textarea></p>
|
||||||
{% else %}
|
{% else %}
|
||||||
<pre id="sql-query">{% if query %}{{ query.sql }}{% endif %}</pre>
|
<pre id="sql-query">{% if query %}{{ query.sql }}{% endif %}</pre>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
|
@ -695,10 +695,8 @@ def test_query_error(app_client):
|
||||||
response = app_client.get("/fixtures?sql=select+*+from+notatable")
|
response = app_client.get("/fixtures?sql=select+*+from+notatable")
|
||||||
html = response.text
|
html = response.text
|
||||||
assert '<p class="message-error">no such table: notatable</p>' in html
|
assert '<p class="message-error">no such table: notatable</p>' in html
|
||||||
assert (
|
assert '<textarea id="sql-editor" name="sql" style="height: 3em' in html
|
||||||
'<textarea id="sql-editor" name="sql">select * from notatable</textarea>'
|
assert ">select * from notatable</textarea>" in html
|
||||||
in html
|
|
||||||
)
|
|
||||||
assert "0 results" not in html
|
assert "0 results" not in html
|
||||||
|
|
||||||
|
|
||||||
|
|
Ładowanie…
Reference in New Issue