-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Extracts data now, but does not save to DB, just returns JSON - refs #1
- Loading branch information
Showing
5 changed files
with
231 additions
and
10 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
{% extends "base.html" %} | ||
|
||
{% block title %}Extract data and create a new table{% endblock %} | ||
|
||
{% block extra_head %} | ||
<link type="text/css" rel="stylesheet" href="/-/static-plugins/datasette-extract/extract.css"> | ||
{% endblock %} | ||
|
||
{% block content %} | ||
<h1>Extract data and create a new table in {{ database }}</h1> | ||
|
||
<form action="{{ request.path }}" method="POST"> | ||
<p> | ||
<input type="hidden" name="csrftoken" value="{{ csrftoken() }}"> | ||
<label for="table">Table name:</label> | ||
<input type="text" name="table" id="table" value="" placeholder="Enter a new table name"> | ||
</p> | ||
{% for field in fields %} | ||
<p> | ||
<label>Name <input type="text" name="name_{{ field }}"></label> | ||
<label>Type <select name="type_{{ field }}"> | ||
<option value="string">Text</option> | ||
<option value="integer">Integer</option> | ||
<option value="float">Float</option> | ||
</select> | ||
</label> | ||
<label>Hint | ||
<input type="text" name="hint_{{ field }}" value="" placeholder="Optional hint"> | ||
</label> | ||
</p> | ||
{% endfor %} | ||
<p> | ||
<textarea name="content" style="width: 100%; height: 20em;" placeholder="Paste content here"></textarea> | ||
</p> | ||
<p> | ||
<input type="submit" value="Extract"> | ||
</p> | ||
</form> | ||
|
||
{% endblock %} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
{% extends "base.html" %} | ||
|
||
{% block title %}Extract{% endblock %} | ||
|
||
{% block extra_head %} | ||
<link type="text/css" rel="stylesheet" href="/-/static-plugins/datasette-extract/extract.css"> | ||
{% endblock %} | ||
|
||
{% block content %} | ||
<h1>Extract data into {{ database }} / {{ table }}</h1> | ||
|
||
<pre> | ||
{{ schema}} | ||
</pre> | ||
|
||
<form action="{{ request.path }}" method="POST"> | ||
<p> | ||
<input type="hidden" name="csrftoken" value="{{ csrftoken() }}"> | ||
<textarea name="content" style="width: 100%; height: 20em;" placeholder="Paste content here"></textarea> | ||
</p> | ||
<p> | ||
<input type="submit" value="Extract"> | ||
</p> | ||
</form> | ||
|
||
{% endblock %} |
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
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