Simplify DB object management with Django CRUD helpers
This commit is contained in:
117
app/urls.py
117
app/urls.py
@@ -46,82 +46,63 @@ urlpatterns = [
|
||||
),
|
||||
path("accounts/", include("django.contrib.auth.urls")),
|
||||
path("accounts/signup/", base.Signup.as_view(), name="signup"),
|
||||
path("hooks/<str:type>/", hooks.Hooks.as_view(), name="hooks"),
|
||||
path("hooks/<str:type>/add/", hooks.HookAction.as_view(), name="hook_action"),
|
||||
path("hooks/<str:type>/", hooks.HookList.as_view(), name="hooks"),
|
||||
path("hooks/<str:type>/create/", hooks.HookCreate.as_view(), name="hook_create"),
|
||||
path(
|
||||
"hooks/<str:type>/add/<str:name>/",
|
||||
hooks.HookAction.as_view(),
|
||||
name="hook_action",
|
||||
"hooks/<str:type>/update/<str:pk>/",
|
||||
hooks.HookUpdate.as_view(),
|
||||
name="hook_update",
|
||||
),
|
||||
path(
|
||||
"hooks/<str:type>/del/<str:hook_id>/",
|
||||
hooks.HookAction.as_view(),
|
||||
name="hook_action",
|
||||
),
|
||||
path(
|
||||
"hooks/<str:type>/edit/<str:hook_id>/",
|
||||
hooks.HookAction.as_view(),
|
||||
name="hook_action",
|
||||
"hooks/<str:type>/delete/<str:pk>/",
|
||||
hooks.HookDelete.as_view(),
|
||||
name="hook_delete",
|
||||
),
|
||||
path(
|
||||
f"{settings.HOOK_PATH}/<str:hook_name>/", hooks.HookAPI.as_view(), name="hook"
|
||||
),
|
||||
path(
|
||||
"callbacks/<str:type>/<str:hook_id>/",
|
||||
"callbacks/<str:type>/<str:pk>/",
|
||||
callbacks.Callbacks.as_view(),
|
||||
name="callbacks",
|
||||
),
|
||||
path("callbacks/<str:type>/", callbacks.Callbacks.as_view(), name="callbacks"),
|
||||
path("accounts/<str:type>/", accounts.Accounts.as_view(), name="accounts"),
|
||||
path("accounts/<str:type>/", accounts.AccountList.as_view(), name="accounts"),
|
||||
path(
|
||||
"accounts/<str:type>/add/",
|
||||
accounts.AccountAction.as_view(),
|
||||
name="account_action",
|
||||
"accounts/<str:type>/create/",
|
||||
accounts.AccountCreate.as_view(),
|
||||
name="account_create",
|
||||
),
|
||||
path(
|
||||
"accounts/<str:type>/add/<str:name>/",
|
||||
accounts.AccountAction.as_view(),
|
||||
name="account_action",
|
||||
),
|
||||
path(
|
||||
"accounts/<str:type>/del/<str:account_id>/",
|
||||
accounts.AccountAction.as_view(),
|
||||
name="account_action",
|
||||
),
|
||||
path(
|
||||
"accounts/<str:type>/edit/<str:account_id>/",
|
||||
accounts.AccountAction.as_view(),
|
||||
name="account_action",
|
||||
),
|
||||
path(
|
||||
"accounts/<str:type>/info/<str:account_id>/",
|
||||
"accounts/<str:type>/info/<str:pk>/",
|
||||
accounts.AccountInfo.as_view(),
|
||||
name="account_info",
|
||||
),
|
||||
path("trades/<str:type>/", trades.Trades.as_view(), name="trades"),
|
||||
path("trades/<str:type>/add/", trades.TradeAction.as_view(), name="trade_action"),
|
||||
path(
|
||||
"trades/<str:type>/<str:account_id>/",
|
||||
trades.Trades.as_view(),
|
||||
name="trades",
|
||||
"accounts/<str:type>/update/<str:pk>/",
|
||||
accounts.AccountUpdate.as_view(),
|
||||
name="account_update",
|
||||
),
|
||||
path(
|
||||
"trades/<str:type>/add/<str:name>/",
|
||||
trades.TradeAction.as_view(),
|
||||
name="trade_action",
|
||||
"accounts/<str:type>/delete/<str:pk>/",
|
||||
accounts.AccountDelete.as_view(),
|
||||
name="account_delete",
|
||||
),
|
||||
path("trades/<str:type>/", trades.TradeList.as_view(), name="trades"),
|
||||
path(
|
||||
"trades/<str:type>/create/", trades.TradeCreate.as_view(), name="trade_create"
|
||||
),
|
||||
path(
|
||||
"trades/<str:type>/del/<str:trade_id>/",
|
||||
trades.TradeAction.as_view(),
|
||||
name="trade_action",
|
||||
"trades/<str:type>/update/<str:pk>/",
|
||||
trades.TradeUpdate.as_view(),
|
||||
name="trade_update",
|
||||
),
|
||||
path(
|
||||
"trades/<str:type>/edit/<str:trade_id>/",
|
||||
trades.TradeAction.as_view(),
|
||||
name="trade_action",
|
||||
"trades/<str:type>/delete/<str:pk>/",
|
||||
trades.TradeDelete.as_view(),
|
||||
name="trade_delete",
|
||||
),
|
||||
path("positions/<str:type>/", positions.Positions.as_view(), name="positions"),
|
||||
# path("trades/<str:type>/add/", trades.TradeAction.as_view(), name="trade_action"),
|
||||
path(
|
||||
"positions/<str:type>/<str:account_id>/",
|
||||
positions.Positions.as_view(),
|
||||
@@ -132,40 +113,22 @@ urlpatterns = [
|
||||
positions.PositionAction.as_view(),
|
||||
name="position_action",
|
||||
),
|
||||
# path(
|
||||
# "trades/<str:type>/add/<str:name>/",
|
||||
# trades.TradeAction.as_view(),
|
||||
# name="trade_action",
|
||||
# ),
|
||||
# path(
|
||||
# "trades/<str:type>/del/<str:trade_id>/",
|
||||
# trades.TradeAction.as_view(),
|
||||
# name="trade_action",
|
||||
# ),
|
||||
# path(
|
||||
# "trades/<str:type>/edit/<str:trade_id>/",
|
||||
# trades.TradeAction.as_view(),
|
||||
# name="trade_action",
|
||||
# ),
|
||||
path("strategies/<str:type>/", strategies.Strategies.as_view(), name="strategies"),
|
||||
path(
|
||||
"strategies/<str:type>/add/",
|
||||
strategies.StrategiesAction.as_view(),
|
||||
name="strategies_action",
|
||||
"strategies/<str:type>/", strategies.StrategyList.as_view(), name="strategies"
|
||||
),
|
||||
path(
|
||||
"strategies/<str:type>/add/<str:name>/",
|
||||
strategies.StrategiesAction.as_view(),
|
||||
name="strategies_action",
|
||||
"strategies/<str:type>/create/",
|
||||
strategies.StrategyCreate.as_view(),
|
||||
name="strategy_create",
|
||||
),
|
||||
path(
|
||||
"strategies/<str:type>/del/<str:strategy_id>/",
|
||||
strategies.StrategiesAction.as_view(),
|
||||
name="strategies_action",
|
||||
"strategies/<str:type>/update/<str:pk>/",
|
||||
strategies.StrategyUpdate.as_view(),
|
||||
name="strategy_update",
|
||||
),
|
||||
path(
|
||||
"strategies/<str:type>/edit/<str:strategy_id>/",
|
||||
strategies.StrategiesAction.as_view(),
|
||||
name="strategies_action",
|
||||
"strategies/<str:type>/delete/<str:pk>/",
|
||||
strategies.StrategyDelete.as_view(),
|
||||
name="strategy_delete",
|
||||
),
|
||||
] + static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)
|
||||
|
||||
Reference in New Issue
Block a user