mirror of
https://github.com/simonw/datasette.git
synced 2025-12-10 16:51:24 +01:00
New URL design /db/table/-/insert, refs #1851
This commit is contained in:
parent
a2a5dff709
commit
6e788b49ed
4 changed files with 86 additions and 13 deletions
|
|
@ -39,7 +39,7 @@ from .views.special import (
|
|||
PermissionsDebugView,
|
||||
MessagesDebugView,
|
||||
)
|
||||
from .views.table import TableView
|
||||
from .views.table import TableView, TableInsertView
|
||||
from .views.row import RowView
|
||||
from .renderer import json_renderer
|
||||
from .url_builder import Urls
|
||||
|
|
@ -1262,6 +1262,10 @@ class Datasette:
|
|||
RowView.as_view(self),
|
||||
r"/(?P<database>[^\/\.]+)/(?P<table>[^/]+?)/(?P<pks>[^/]+?)(\.(?P<format>\w+))?$",
|
||||
)
|
||||
add_route(
|
||||
TableInsertView.as_view(self),
|
||||
r"/(?P<database>[^\/\.]+)/(?P<table>[^\/\.]+)/-/insert$",
|
||||
)
|
||||
return [
|
||||
# Compile any strings to regular expressions
|
||||
((re.compile(pattern) if isinstance(pattern, str) else pattern), view)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue