starlette-admin 0.11.0.dev0__tar.gz → 0.11.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {starlette_admin-0.11.0.dev0 → starlette_admin-0.11.1}/PKG-INFO +1 -1
- {starlette_admin-0.11.0.dev0 → starlette_admin-0.11.1}/starlette_admin/__init__.py +1 -1
- {starlette_admin-0.11.0.dev0 → starlette_admin-0.11.1}/starlette_admin/base.py +7 -5
- {starlette_admin-0.11.0.dev0 → starlette_admin-0.11.1}/starlette_admin/contrib/mongoengine/view.py +1 -1
- {starlette_admin-0.11.0.dev0 → starlette_admin-0.11.1}/starlette_admin/contrib/odmantic/view.py +1 -1
- {starlette_admin-0.11.0.dev0 → starlette_admin-0.11.1}/starlette_admin/contrib/sqla/view.py +5 -4
- {starlette_admin-0.11.0.dev0 → starlette_admin-0.11.1}/starlette_admin/views.py +4 -15
- {starlette_admin-0.11.0.dev0 → starlette_admin-0.11.1}/.gitignore +0 -0
- {starlette_admin-0.11.0.dev0 → starlette_admin-0.11.1}/LICENSE +0 -0
- {starlette_admin-0.11.0.dev0 → starlette_admin-0.11.1}/README.md +0 -0
- {starlette_admin-0.11.0.dev0 → starlette_admin-0.11.1}/pyproject.toml +0 -0
- {starlette_admin-0.11.0.dev0 → starlette_admin-0.11.1}/starlette_admin/_types.py +0 -0
- {starlette_admin-0.11.0.dev0 → starlette_admin-0.11.1}/starlette_admin/actions.py +0 -0
- {starlette_admin-0.11.0.dev0 → starlette_admin-0.11.1}/starlette_admin/auth.py +0 -0
- {starlette_admin-0.11.0.dev0 → starlette_admin-0.11.1}/starlette_admin/contrib/__init__.py +0 -0
- {starlette_admin-0.11.0.dev0 → starlette_admin-0.11.1}/starlette_admin/contrib/mongoengine/__init__.py +0 -0
- {starlette_admin-0.11.0.dev0 → starlette_admin-0.11.1}/starlette_admin/contrib/mongoengine/admin.py +0 -0
- {starlette_admin-0.11.0.dev0 → starlette_admin-0.11.1}/starlette_admin/contrib/mongoengine/converters.py +0 -0
- {starlette_admin-0.11.0.dev0 → starlette_admin-0.11.1}/starlette_admin/contrib/mongoengine/exceptions.py +0 -0
- {starlette_admin-0.11.0.dev0 → starlette_admin-0.11.1}/starlette_admin/contrib/mongoengine/fields.py +0 -0
- {starlette_admin-0.11.0.dev0 → starlette_admin-0.11.1}/starlette_admin/contrib/mongoengine/helpers.py +0 -0
- {starlette_admin-0.11.0.dev0 → starlette_admin-0.11.1}/starlette_admin/contrib/odmantic/__init__.py +0 -0
- {starlette_admin-0.11.0.dev0 → starlette_admin-0.11.1}/starlette_admin/contrib/odmantic/admin.py +0 -0
- {starlette_admin-0.11.0.dev0 → starlette_admin-0.11.1}/starlette_admin/contrib/odmantic/converters.py +0 -0
- {starlette_admin-0.11.0.dev0 → starlette_admin-0.11.1}/starlette_admin/contrib/odmantic/exceptions.py +0 -0
- {starlette_admin-0.11.0.dev0 → starlette_admin-0.11.1}/starlette_admin/contrib/odmantic/helpers.py +0 -0
- {starlette_admin-0.11.0.dev0 → starlette_admin-0.11.1}/starlette_admin/contrib/odmantic/middleware.py +0 -0
- {starlette_admin-0.11.0.dev0 → starlette_admin-0.11.1}/starlette_admin/contrib/sqla/__init__.py +0 -0
- {starlette_admin-0.11.0.dev0 → starlette_admin-0.11.1}/starlette_admin/contrib/sqla/admin.py +0 -0
- {starlette_admin-0.11.0.dev0 → starlette_admin-0.11.1}/starlette_admin/contrib/sqla/converters.py +0 -0
- {starlette_admin-0.11.0.dev0 → starlette_admin-0.11.1}/starlette_admin/contrib/sqla/exceptions.py +0 -0
- {starlette_admin-0.11.0.dev0 → starlette_admin-0.11.1}/starlette_admin/contrib/sqla/ext/__init__.py +0 -0
- {starlette_admin-0.11.0.dev0 → starlette_admin-0.11.1}/starlette_admin/contrib/sqla/ext/pydantic.py +0 -0
- {starlette_admin-0.11.0.dev0 → starlette_admin-0.11.1}/starlette_admin/contrib/sqla/fields.py +0 -0
- {starlette_admin-0.11.0.dev0 → starlette_admin-0.11.1}/starlette_admin/contrib/sqla/helpers.py +0 -0
- {starlette_admin-0.11.0.dev0 → starlette_admin-0.11.1}/starlette_admin/contrib/sqla/middleware.py +0 -0
- {starlette_admin-0.11.0.dev0 → starlette_admin-0.11.1}/starlette_admin/contrib/sqlmodel/__init__.py +0 -0
- {starlette_admin-0.11.0.dev0 → starlette_admin-0.11.1}/starlette_admin/contrib/sqlmodel/admin.py +0 -0
- {starlette_admin-0.11.0.dev0 → starlette_admin-0.11.1}/starlette_admin/contrib/sqlmodel/view.py +0 -0
- {starlette_admin-0.11.0.dev0 → starlette_admin-0.11.1}/starlette_admin/converters.py +0 -0
- {starlette_admin-0.11.0.dev0 → starlette_admin-0.11.1}/starlette_admin/exceptions.py +0 -0
- {starlette_admin-0.11.0.dev0 → starlette_admin-0.11.1}/starlette_admin/fields.py +0 -0
- {starlette_admin-0.11.0.dev0 → starlette_admin-0.11.1}/starlette_admin/helpers.py +0 -0
- {starlette_admin-0.11.0.dev0 → starlette_admin-0.11.1}/starlette_admin/i18n.py +0 -0
- {starlette_admin-0.11.0.dev0 → starlette_admin-0.11.1}/starlette_admin/py.typed +0 -0
- {starlette_admin-0.11.0.dev0 → starlette_admin-0.11.1}/starlette_admin/statics/css/dt.checkboxes.css +0 -0
- {starlette_admin-0.11.0.dev0 → starlette_admin-0.11.1}/starlette_admin/statics/css/dt.min.css +0 -0
- {starlette_admin-0.11.0.dev0 → starlette_admin-0.11.1}/starlette_admin/statics/css/flatpickr.min.css +0 -0
- {starlette_admin-0.11.0.dev0 → starlette_admin-0.11.1}/starlette_admin/statics/css/fontawesome.min.css +0 -0
- {starlette_admin-0.11.0.dev0 → starlette_admin-0.11.1}/starlette_admin/statics/css/img/jsoneditor-icons.svg +0 -0
- {starlette_admin-0.11.0.dev0 → starlette_admin-0.11.1}/starlette_admin/statics/css/jsoneditor.min.css +0 -0
- {starlette_admin-0.11.0.dev0 → starlette_admin-0.11.1}/starlette_admin/statics/css/select2.min.css +0 -0
- {starlette_admin-0.11.0.dev0 → starlette_admin-0.11.1}/starlette_admin/statics/css/tabler.min.css +0 -0
- {starlette_admin-0.11.0.dev0 → starlette_admin-0.11.1}/starlette_admin/statics/i18n/dt/README.md +0 -0
- {starlette_admin-0.11.0.dev0 → starlette_admin-0.11.1}/starlette_admin/statics/i18n/dt/en.json +0 -0
- {starlette_admin-0.11.0.dev0 → starlette_admin-0.11.1}/starlette_admin/statics/i18n/dt/fr.json +0 -0
- {starlette_admin-0.11.0.dev0 → starlette_admin-0.11.1}/starlette_admin/statics/i18n/dt/ru.json +0 -0
- {starlette_admin-0.11.0.dev0 → starlette_admin-0.11.1}/starlette_admin/statics/i18n/flatpickr/fr.js +0 -0
- {starlette_admin-0.11.0.dev0 → starlette_admin-0.11.1}/starlette_admin/statics/i18n/flatpickr/ru.js +0 -0
- {starlette_admin-0.11.0.dev0 → starlette_admin-0.11.1}/starlette_admin/statics/i18n/momentjs/fr.js +0 -0
- {starlette_admin-0.11.0.dev0 → starlette_admin-0.11.1}/starlette_admin/statics/i18n/momentjs/ru.js +0 -0
- {starlette_admin-0.11.0.dev0 → starlette_admin-0.11.1}/starlette_admin/statics/js/displays.js +0 -0
- {starlette_admin-0.11.0.dev0 → starlette_admin-0.11.1}/starlette_admin/statics/js/form.js +0 -0
- {starlette_admin-0.11.0.dev0 → starlette_admin-0.11.1}/starlette_admin/statics/js/list.js +0 -0
- {starlette_admin-0.11.0.dev0 → starlette_admin-0.11.1}/starlette_admin/statics/js/render.js +0 -0
- {starlette_admin-0.11.0.dev0 → starlette_admin-0.11.1}/starlette_admin/statics/js/utils.js +0 -0
- {starlette_admin-0.11.0.dev0 → starlette_admin-0.11.1}/starlette_admin/statics/js/vendor/dt.checkboxes.js +0 -0
- {starlette_admin-0.11.0.dev0 → starlette_admin-0.11.1}/starlette_admin/statics/js/vendor/dt.min.js +0 -0
- {starlette_admin-0.11.0.dev0 → starlette_admin-0.11.1}/starlette_admin/statics/js/vendor/dt.searchHighlight.js +0 -0
- {starlette_admin-0.11.0.dev0 → starlette_admin-0.11.1}/starlette_admin/statics/js/vendor/flatpickr.min.js +0 -0
- {starlette_admin-0.11.0.dev0 → starlette_admin-0.11.1}/starlette_admin/statics/js/vendor/jquery.min.js +0 -0
- {starlette_admin-0.11.0.dev0 → starlette_admin-0.11.1}/starlette_admin/statics/js/vendor/js.cookie.min.js +0 -0
- {starlette_admin-0.11.0.dev0 → starlette_admin-0.11.1}/starlette_admin/statics/js/vendor/jsoneditor.min.js +0 -0
- {starlette_admin-0.11.0.dev0 → starlette_admin-0.11.1}/starlette_admin/statics/js/vendor/moment.min.js +0 -0
- {starlette_admin-0.11.0.dev0 → starlette_admin-0.11.1}/starlette_admin/statics/js/vendor/pdfmake.min.js +0 -0
- {starlette_admin-0.11.0.dev0 → starlette_admin-0.11.1}/starlette_admin/statics/js/vendor/select2.min.js +0 -0
- {starlette_admin-0.11.0.dev0 → starlette_admin-0.11.1}/starlette_admin/statics/js/vendor/tabler.min.js +0 -0
- {starlette_admin-0.11.0.dev0 → starlette_admin-0.11.1}/starlette_admin/statics/js/vendor/vfs_fonts.js +0 -0
- {starlette_admin-0.11.0.dev0 → starlette_admin-0.11.1}/starlette_admin/statics/webfonts/fa-brands-400.ttf +0 -0
- {starlette_admin-0.11.0.dev0 → starlette_admin-0.11.1}/starlette_admin/statics/webfonts/fa-brands-400.woff2 +0 -0
- {starlette_admin-0.11.0.dev0 → starlette_admin-0.11.1}/starlette_admin/statics/webfonts/fa-regular-400.ttf +0 -0
- {starlette_admin-0.11.0.dev0 → starlette_admin-0.11.1}/starlette_admin/statics/webfonts/fa-regular-400.woff2 +0 -0
- {starlette_admin-0.11.0.dev0 → starlette_admin-0.11.1}/starlette_admin/statics/webfonts/fa-solid-900.ttf +0 -0
- {starlette_admin-0.11.0.dev0 → starlette_admin-0.11.1}/starlette_admin/statics/webfonts/fa-solid-900.woff2 +0 -0
- {starlette_admin-0.11.0.dev0 → starlette_admin-0.11.1}/starlette_admin/statics/webfonts/fa-v4compatibility.ttf +0 -0
- {starlette_admin-0.11.0.dev0 → starlette_admin-0.11.1}/starlette_admin/statics/webfonts/fa-v4compatibility.woff2 +0 -0
- {starlette_admin-0.11.0.dev0 → starlette_admin-0.11.1}/starlette_admin/templates/base.html +0 -0
- {starlette_admin-0.11.0.dev0 → starlette_admin-0.11.1}/starlette_admin/templates/create.html +0 -0
- {starlette_admin-0.11.0.dev0 → starlette_admin-0.11.1}/starlette_admin/templates/detail.html +0 -0
- {starlette_admin-0.11.0.dev0 → starlette_admin-0.11.1}/starlette_admin/templates/displays/_empty.html +0 -0
- {starlette_admin-0.11.0.dev0 → starlette_admin-0.11.1}/starlette_admin/templates/displays/_null.html +0 -0
- {starlette_admin-0.11.0.dev0 → starlette_admin-0.11.1}/starlette_admin/templates/displays/boolean.html +0 -0
- {starlette_admin-0.11.0.dev0 → starlette_admin-0.11.1}/starlette_admin/templates/displays/collection.html +0 -0
- {starlette_admin-0.11.0.dev0 → starlette_admin-0.11.1}/starlette_admin/templates/displays/email.html +0 -0
- {starlette_admin-0.11.0.dev0 → starlette_admin-0.11.1}/starlette_admin/templates/displays/file.html +0 -0
- {starlette_admin-0.11.0.dev0 → starlette_admin-0.11.1}/starlette_admin/templates/displays/image.html +0 -0
- {starlette_admin-0.11.0.dev0 → starlette_admin-0.11.1}/starlette_admin/templates/displays/json.html +0 -0
- {starlette_admin-0.11.0.dev0 → starlette_admin-0.11.1}/starlette_admin/templates/displays/list.html +0 -0
- {starlette_admin-0.11.0.dev0 → starlette_admin-0.11.1}/starlette_admin/templates/displays/relation.html +0 -0
- {starlette_admin-0.11.0.dev0 → starlette_admin-0.11.1}/starlette_admin/templates/displays/text.html +0 -0
- {starlette_admin-0.11.0.dev0 → starlette_admin-0.11.1}/starlette_admin/templates/displays/textarea.html +0 -0
- {starlette_admin-0.11.0.dev0 → starlette_admin-0.11.1}/starlette_admin/templates/displays/tinymce.html +0 -0
- {starlette_admin-0.11.0.dev0 → starlette_admin-0.11.1}/starlette_admin/templates/displays/url.html +0 -0
- {starlette_admin-0.11.0.dev0 → starlette_admin-0.11.1}/starlette_admin/templates/edit.html +0 -0
- {starlette_admin-0.11.0.dev0 → starlette_admin-0.11.1}/starlette_admin/templates/error.html +0 -0
- {starlette_admin-0.11.0.dev0 → starlette_admin-0.11.1}/starlette_admin/templates/forms/_delete.html +0 -0
- {starlette_admin-0.11.0.dev0 → starlette_admin-0.11.1}/starlette_admin/templates/forms/_error.html +0 -0
- {starlette_admin-0.11.0.dev0 → starlette_admin-0.11.1}/starlette_admin/templates/forms/_label.html +0 -0
- {starlette_admin-0.11.0.dev0 → starlette_admin-0.11.1}/starlette_admin/templates/forms/boolean.html +0 -0
- {starlette_admin-0.11.0.dev0 → starlette_admin-0.11.1}/starlette_admin/templates/forms/collection.html +0 -0
- {starlette_admin-0.11.0.dev0 → starlette_admin-0.11.1}/starlette_admin/templates/forms/enum.html +0 -0
- {starlette_admin-0.11.0.dev0 → starlette_admin-0.11.1}/starlette_admin/templates/forms/file.html +0 -0
- {starlette_admin-0.11.0.dev0 → starlette_admin-0.11.1}/starlette_admin/templates/forms/image.html +0 -0
- {starlette_admin-0.11.0.dev0 → starlette_admin-0.11.1}/starlette_admin/templates/forms/input.html +0 -0
- {starlette_admin-0.11.0.dev0 → starlette_admin-0.11.1}/starlette_admin/templates/forms/json.html +0 -0
- {starlette_admin-0.11.0.dev0 → starlette_admin-0.11.1}/starlette_admin/templates/forms/list.html +0 -0
- {starlette_admin-0.11.0.dev0 → starlette_admin-0.11.1}/starlette_admin/templates/forms/relation.html +0 -0
- {starlette_admin-0.11.0.dev0 → starlette_admin-0.11.1}/starlette_admin/templates/forms/tags.html +0 -0
- {starlette_admin-0.11.0.dev0 → starlette_admin-0.11.1}/starlette_admin/templates/forms/textarea.html +0 -0
- {starlette_admin-0.11.0.dev0 → starlette_admin-0.11.1}/starlette_admin/templates/index.html +0 -0
- {starlette_admin-0.11.0.dev0 → starlette_admin-0.11.1}/starlette_admin/templates/layout.html +0 -0
- {starlette_admin-0.11.0.dev0 → starlette_admin-0.11.1}/starlette_admin/templates/list.html +0 -0
- {starlette_admin-0.11.0.dev0 → starlette_admin-0.11.1}/starlette_admin/templates/login.html +0 -0
- {starlette_admin-0.11.0.dev0 → starlette_admin-0.11.1}/starlette_admin/templates/macros/views.html +0 -0
- {starlette_admin-0.11.0.dev0 → starlette_admin-0.11.1}/starlette_admin/templates/modals/actions.html +0 -0
- {starlette_admin-0.11.0.dev0 → starlette_admin-0.11.1}/starlette_admin/templates/modals/delete.html +0 -0
- {starlette_admin-0.11.0.dev0 → starlette_admin-0.11.1}/starlette_admin/templates/modals/error.html +0 -0
- {starlette_admin-0.11.0.dev0 → starlette_admin-0.11.1}/starlette_admin/templates/modals/loading.html +0 -0
- {starlette_admin-0.11.0.dev0 → starlette_admin-0.11.1}/starlette_admin/translations/en/LC_MESSAGES/admin.mo +0 -0
- {starlette_admin-0.11.0.dev0 → starlette_admin-0.11.1}/starlette_admin/translations/en/LC_MESSAGES/admin.po +0 -0
- {starlette_admin-0.11.0.dev0 → starlette_admin-0.11.1}/starlette_admin/translations/fr/LC_MESSAGES/admin.mo +0 -0
- {starlette_admin-0.11.0.dev0 → starlette_admin-0.11.1}/starlette_admin/translations/fr/LC_MESSAGES/admin.po +0 -0
- {starlette_admin-0.11.0.dev0 → starlette_admin-0.11.1}/starlette_admin/translations/ru/LC_MESSAGES/admin.mo +0 -0
- {starlette_admin-0.11.0.dev0 → starlette_admin-0.11.1}/starlette_admin/translations/ru/LC_MESSAGES/admin.po +0 -0
- {starlette_admin-0.11.0.dev0 → starlette_admin-0.11.1}/starlette_admin/utils/__init__.py +0 -0
- {starlette_admin-0.11.0.dev0 → starlette_admin-0.11.1}/starlette_admin/utils/countries.py +0 -0
- {starlette_admin-0.11.0.dev0 → starlette_admin-0.11.1}/starlette_admin/utils/timezones.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: starlette-admin
|
|
3
|
-
Version: 0.11.
|
|
3
|
+
Version: 0.11.1
|
|
4
4
|
Summary: Fast, beautiful and extensible administrative interface framework for Starlette/FastApi applications
|
|
5
5
|
Project-URL: Homepage, https://github.com/jowilf/starlette-admin
|
|
6
6
|
Project-URL: Documentation, https://jowilf.github.io/starlette-admin
|
|
@@ -259,6 +259,7 @@ class BaseAdmin:
|
|
|
259
259
|
return wrapper
|
|
260
260
|
|
|
261
261
|
async def _render_api(self, request: Request) -> Response:
|
|
262
|
+
request.state.action = RequestAction.LIST
|
|
262
263
|
identity = request.path_params.get("identity")
|
|
263
264
|
model = self._find_model_from_identity(identity)
|
|
264
265
|
if not model.is_accessible(request):
|
|
@@ -305,6 +306,7 @@ class BaseAdmin:
|
|
|
305
306
|
)
|
|
306
307
|
|
|
307
308
|
async def handle_action(self, request: Request) -> Response:
|
|
309
|
+
request.state.action = RequestAction.LIST
|
|
308
310
|
try:
|
|
309
311
|
identity = request.path_params.get("identity")
|
|
310
312
|
pks = request.query_params.getlist("pks")
|
|
@@ -321,6 +323,7 @@ class BaseAdmin:
|
|
|
321
323
|
return JSONResponse({"msg": exc.msg}, status_code=HTTP_400_BAD_REQUEST)
|
|
322
324
|
|
|
323
325
|
async def _render_list(self, request: Request) -> Response:
|
|
326
|
+
request.state.action = RequestAction.LIST
|
|
324
327
|
identity = request.path_params.get("identity")
|
|
325
328
|
model = self._find_model_from_identity(identity)
|
|
326
329
|
if not model.is_accessible(request):
|
|
@@ -336,6 +339,7 @@ class BaseAdmin:
|
|
|
336
339
|
)
|
|
337
340
|
|
|
338
341
|
async def _render_detail(self, request: Request) -> Response:
|
|
342
|
+
request.state.action = RequestAction.DETAIL
|
|
339
343
|
identity = request.path_params.get("identity")
|
|
340
344
|
model = self._find_model_from_identity(identity)
|
|
341
345
|
if not model.is_accessible(request) or not model.can_view_details(request):
|
|
@@ -355,6 +359,7 @@ class BaseAdmin:
|
|
|
355
359
|
)
|
|
356
360
|
|
|
357
361
|
async def _render_create(self, request: Request) -> Response:
|
|
362
|
+
request.state.action = RequestAction.CREATE
|
|
358
363
|
identity = request.path_params.get("identity")
|
|
359
364
|
model = self._find_model_from_identity(identity)
|
|
360
365
|
if not model.is_accessible(request) or not model.can_create(request):
|
|
@@ -390,6 +395,7 @@ class BaseAdmin:
|
|
|
390
395
|
return RedirectResponse(url, status_code=HTTP_303_SEE_OTHER)
|
|
391
396
|
|
|
392
397
|
async def _render_edit(self, request: Request) -> Response:
|
|
398
|
+
request.state.action = RequestAction.EDIT
|
|
393
399
|
identity = request.path_params.get("identity")
|
|
394
400
|
model = self._find_model_from_identity(identity)
|
|
395
401
|
if not model.is_accessible(request) or not model.can_edit(request):
|
|
@@ -453,11 +459,7 @@ class BaseAdmin:
|
|
|
453
459
|
action: RequestAction,
|
|
454
460
|
) -> Dict[str, Any]:
|
|
455
461
|
data = {}
|
|
456
|
-
for field in model.
|
|
457
|
-
if (action == RequestAction.EDIT and field.exclude_from_edit) or (
|
|
458
|
-
action == RequestAction.CREATE and field.exclude_from_create
|
|
459
|
-
):
|
|
460
|
-
continue
|
|
462
|
+
for field in model.get_fields_list(request, action):
|
|
461
463
|
data[field.name] = await field.parse_form_data(request, form_data, action)
|
|
462
464
|
return data
|
|
463
465
|
|
{starlette_admin-0.11.0.dev0 → starlette_admin-0.11.1}/starlette_admin/contrib/mongoengine/view.py
RENAMED
|
@@ -223,7 +223,7 @@ class ModelView(BaseModelView):
|
|
|
223
223
|
|
|
224
224
|
async def build_full_text_search_query(self, request: Request, term: str) -> QNode:
|
|
225
225
|
queries = []
|
|
226
|
-
for field in self.
|
|
226
|
+
for field in self.get_fields_list(request):
|
|
227
227
|
if (
|
|
228
228
|
field.searchable
|
|
229
229
|
and field.name != "id"
|
|
@@ -8,6 +8,7 @@ from sqlalchemy.orm import InstrumentedAttribute, Mapper, Session, joinedload
|
|
|
8
8
|
from sqlalchemy.sql import Select
|
|
9
9
|
from starlette.requests import Request
|
|
10
10
|
from starlette.responses import Response
|
|
11
|
+
from starlette_admin._types import RequestAction
|
|
11
12
|
from starlette_admin.contrib.sqla.converters import (
|
|
12
13
|
BaseSQLAModelConverter,
|
|
13
14
|
ModelConverter,
|
|
@@ -165,7 +166,7 @@ class ModelView(BaseModelView):
|
|
|
165
166
|
```
|
|
166
167
|
"""
|
|
167
168
|
clauses = []
|
|
168
|
-
for field in self.
|
|
169
|
+
for field in self.get_fields_list(request):
|
|
169
170
|
if field.searchable and type(field) in [
|
|
170
171
|
StringField,
|
|
171
172
|
TextAreaField,
|
|
@@ -218,7 +219,7 @@ class ModelView(BaseModelView):
|
|
|
218
219
|
)
|
|
219
220
|
stmt = stmt.where(where) # type: ignore
|
|
220
221
|
stmt = stmt.order_by(*build_order_clauses(order_by or [], self.model))
|
|
221
|
-
for field in self.
|
|
222
|
+
for field in self.get_fields_list(request, RequestAction.LIST):
|
|
222
223
|
if isinstance(field, RelationField):
|
|
223
224
|
stmt = stmt.options(joinedload(getattr(self.model, field.name)))
|
|
224
225
|
if isinstance(session, AsyncSession):
|
|
@@ -233,7 +234,7 @@ class ModelView(BaseModelView):
|
|
|
233
234
|
async def find_by_pk(self, request: Request, pk: Any) -> Any:
|
|
234
235
|
session: Union[Session, AsyncSession] = request.state.session
|
|
235
236
|
stmt = select(self.model).where(self._pk_column == self._pk_coerce(pk))
|
|
236
|
-
for field in self.
|
|
237
|
+
for field in self.get_fields_list(request, request.state.action):
|
|
237
238
|
if isinstance(field, RelationField):
|
|
238
239
|
stmt = stmt.options(joinedload(getattr(self.model, field.name)))
|
|
239
240
|
if isinstance(session, AsyncSession):
|
|
@@ -248,7 +249,7 @@ class ModelView(BaseModelView):
|
|
|
248
249
|
async def find_by_pks(self, request: Request, pks: List[Any]) -> Sequence[Any]:
|
|
249
250
|
session: Union[Session, AsyncSession] = request.state.session
|
|
250
251
|
stmt = select(self.model).where(self._pk_column.in_(map(self._pk_coerce, pks)))
|
|
251
|
-
for field in self.
|
|
252
|
+
for field in self.get_fields_list(request, request.state.action):
|
|
252
253
|
if isinstance(field, RelationField):
|
|
253
254
|
stmt = stmt.options(joinedload(getattr(self.model, field.name)))
|
|
254
255
|
if isinstance(session, AsyncSession):
|
|
@@ -505,7 +505,7 @@ class BaseModelView(BaseView):
|
|
|
505
505
|
include_select2: bool = False,
|
|
506
506
|
) -> Dict[str, Any]:
|
|
507
507
|
obj_serialized: Dict[str, Any] = {}
|
|
508
|
-
for field in self.
|
|
508
|
+
for field in self.get_fields_list(request, action):
|
|
509
509
|
if isinstance(field, RelationField) and include_relationships:
|
|
510
510
|
value = getattr(obj, field.name, None)
|
|
511
511
|
foreign_model = self._find_foreign_model(field.identity) # type: ignore
|
|
@@ -633,7 +633,7 @@ class BaseModelView(BaseView):
|
|
|
633
633
|
)
|
|
634
634
|
fields = [
|
|
635
635
|
field.name
|
|
636
|
-
for field in self.
|
|
636
|
+
for field in self.get_fields_list(request)
|
|
637
637
|
if (
|
|
638
638
|
not isinstance(field, (RelationField, FileField))
|
|
639
639
|
and not field.exclude_from_detail
|
|
@@ -701,14 +701,7 @@ class BaseModelView(BaseView):
|
|
|
701
701
|
self, request: Request, action: RequestAction
|
|
702
702
|
) -> Sequence[str]:
|
|
703
703
|
links = []
|
|
704
|
-
for field in self.
|
|
705
|
-
if (
|
|
706
|
-
(action == RequestAction.LIST and field.exclude_from_list)
|
|
707
|
-
or (action == RequestAction.DETAIL and field.exclude_from_detail)
|
|
708
|
-
or (action == RequestAction.CREATE and field.exclude_from_create)
|
|
709
|
-
or (action == RequestAction.EDIT and field.exclude_from_edit)
|
|
710
|
-
):
|
|
711
|
-
continue
|
|
704
|
+
for field in self.get_fields_list(request, action):
|
|
712
705
|
for link in field.additional_css_links(request, action) or []:
|
|
713
706
|
if link not in links:
|
|
714
707
|
links.append(link)
|
|
@@ -718,11 +711,7 @@ class BaseModelView(BaseView):
|
|
|
718
711
|
self, request: Request, action: RequestAction
|
|
719
712
|
) -> Sequence[str]:
|
|
720
713
|
links = []
|
|
721
|
-
for field in self.
|
|
722
|
-
if (action == RequestAction.CREATE and field.exclude_from_create) or (
|
|
723
|
-
action == RequestAction.EDIT and field.exclude_from_edit
|
|
724
|
-
):
|
|
725
|
-
continue
|
|
714
|
+
for field in self.get_fields_list(request, action):
|
|
726
715
|
for link in field.additional_js_links(request, action) or []:
|
|
727
716
|
if link not in links:
|
|
728
717
|
links.append(link)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{starlette_admin-0.11.0.dev0 → starlette_admin-0.11.1}/starlette_admin/contrib/mongoengine/admin.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{starlette_admin-0.11.0.dev0 → starlette_admin-0.11.1}/starlette_admin/contrib/mongoengine/fields.py
RENAMED
|
File without changes
|
|
File without changes
|
{starlette_admin-0.11.0.dev0 → starlette_admin-0.11.1}/starlette_admin/contrib/odmantic/__init__.py
RENAMED
|
File without changes
|
{starlette_admin-0.11.0.dev0 → starlette_admin-0.11.1}/starlette_admin/contrib/odmantic/admin.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{starlette_admin-0.11.0.dev0 → starlette_admin-0.11.1}/starlette_admin/contrib/odmantic/helpers.py
RENAMED
|
File without changes
|
|
File without changes
|
{starlette_admin-0.11.0.dev0 → starlette_admin-0.11.1}/starlette_admin/contrib/sqla/__init__.py
RENAMED
|
File without changes
|
{starlette_admin-0.11.0.dev0 → starlette_admin-0.11.1}/starlette_admin/contrib/sqla/admin.py
RENAMED
|
File without changes
|
{starlette_admin-0.11.0.dev0 → starlette_admin-0.11.1}/starlette_admin/contrib/sqla/converters.py
RENAMED
|
File without changes
|
{starlette_admin-0.11.0.dev0 → starlette_admin-0.11.1}/starlette_admin/contrib/sqla/exceptions.py
RENAMED
|
File without changes
|
{starlette_admin-0.11.0.dev0 → starlette_admin-0.11.1}/starlette_admin/contrib/sqla/ext/__init__.py
RENAMED
|
File without changes
|
{starlette_admin-0.11.0.dev0 → starlette_admin-0.11.1}/starlette_admin/contrib/sqla/ext/pydantic.py
RENAMED
|
File without changes
|
{starlette_admin-0.11.0.dev0 → starlette_admin-0.11.1}/starlette_admin/contrib/sqla/fields.py
RENAMED
|
File without changes
|
{starlette_admin-0.11.0.dev0 → starlette_admin-0.11.1}/starlette_admin/contrib/sqla/helpers.py
RENAMED
|
File without changes
|
{starlette_admin-0.11.0.dev0 → starlette_admin-0.11.1}/starlette_admin/contrib/sqla/middleware.py
RENAMED
|
File without changes
|
{starlette_admin-0.11.0.dev0 → starlette_admin-0.11.1}/starlette_admin/contrib/sqlmodel/__init__.py
RENAMED
|
File without changes
|
{starlette_admin-0.11.0.dev0 → starlette_admin-0.11.1}/starlette_admin/contrib/sqlmodel/admin.py
RENAMED
|
File without changes
|
{starlette_admin-0.11.0.dev0 → starlette_admin-0.11.1}/starlette_admin/contrib/sqlmodel/view.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{starlette_admin-0.11.0.dev0 → starlette_admin-0.11.1}/starlette_admin/statics/css/dt.checkboxes.css
RENAMED
|
File without changes
|
{starlette_admin-0.11.0.dev0 → starlette_admin-0.11.1}/starlette_admin/statics/css/dt.min.css
RENAMED
|
File without changes
|
{starlette_admin-0.11.0.dev0 → starlette_admin-0.11.1}/starlette_admin/statics/css/flatpickr.min.css
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{starlette_admin-0.11.0.dev0 → starlette_admin-0.11.1}/starlette_admin/statics/css/select2.min.css
RENAMED
|
File without changes
|
{starlette_admin-0.11.0.dev0 → starlette_admin-0.11.1}/starlette_admin/statics/css/tabler.min.css
RENAMED
|
File without changes
|
{starlette_admin-0.11.0.dev0 → starlette_admin-0.11.1}/starlette_admin/statics/i18n/dt/README.md
RENAMED
|
File without changes
|
{starlette_admin-0.11.0.dev0 → starlette_admin-0.11.1}/starlette_admin/statics/i18n/dt/en.json
RENAMED
|
File without changes
|
{starlette_admin-0.11.0.dev0 → starlette_admin-0.11.1}/starlette_admin/statics/i18n/dt/fr.json
RENAMED
|
File without changes
|
{starlette_admin-0.11.0.dev0 → starlette_admin-0.11.1}/starlette_admin/statics/i18n/dt/ru.json
RENAMED
|
File without changes
|
{starlette_admin-0.11.0.dev0 → starlette_admin-0.11.1}/starlette_admin/statics/i18n/flatpickr/fr.js
RENAMED
|
File without changes
|
{starlette_admin-0.11.0.dev0 → starlette_admin-0.11.1}/starlette_admin/statics/i18n/flatpickr/ru.js
RENAMED
|
File without changes
|
{starlette_admin-0.11.0.dev0 → starlette_admin-0.11.1}/starlette_admin/statics/i18n/momentjs/fr.js
RENAMED
|
File without changes
|
{starlette_admin-0.11.0.dev0 → starlette_admin-0.11.1}/starlette_admin/statics/i18n/momentjs/ru.js
RENAMED
|
File without changes
|
{starlette_admin-0.11.0.dev0 → starlette_admin-0.11.1}/starlette_admin/statics/js/displays.js
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{starlette_admin-0.11.0.dev0 → starlette_admin-0.11.1}/starlette_admin/statics/js/vendor/dt.min.js
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{starlette_admin-0.11.0.dev0 → starlette_admin-0.11.1}/starlette_admin/templates/create.html
RENAMED
|
File without changes
|
{starlette_admin-0.11.0.dev0 → starlette_admin-0.11.1}/starlette_admin/templates/detail.html
RENAMED
|
File without changes
|
|
File without changes
|
{starlette_admin-0.11.0.dev0 → starlette_admin-0.11.1}/starlette_admin/templates/displays/_null.html
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{starlette_admin-0.11.0.dev0 → starlette_admin-0.11.1}/starlette_admin/templates/displays/email.html
RENAMED
|
File without changes
|
{starlette_admin-0.11.0.dev0 → starlette_admin-0.11.1}/starlette_admin/templates/displays/file.html
RENAMED
|
File without changes
|
{starlette_admin-0.11.0.dev0 → starlette_admin-0.11.1}/starlette_admin/templates/displays/image.html
RENAMED
|
File without changes
|
{starlette_admin-0.11.0.dev0 → starlette_admin-0.11.1}/starlette_admin/templates/displays/json.html
RENAMED
|
File without changes
|
{starlette_admin-0.11.0.dev0 → starlette_admin-0.11.1}/starlette_admin/templates/displays/list.html
RENAMED
|
File without changes
|
|
File without changes
|
{starlette_admin-0.11.0.dev0 → starlette_admin-0.11.1}/starlette_admin/templates/displays/text.html
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{starlette_admin-0.11.0.dev0 → starlette_admin-0.11.1}/starlette_admin/templates/displays/url.html
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{starlette_admin-0.11.0.dev0 → starlette_admin-0.11.1}/starlette_admin/templates/forms/_delete.html
RENAMED
|
File without changes
|
{starlette_admin-0.11.0.dev0 → starlette_admin-0.11.1}/starlette_admin/templates/forms/_error.html
RENAMED
|
File without changes
|
{starlette_admin-0.11.0.dev0 → starlette_admin-0.11.1}/starlette_admin/templates/forms/_label.html
RENAMED
|
File without changes
|
{starlette_admin-0.11.0.dev0 → starlette_admin-0.11.1}/starlette_admin/templates/forms/boolean.html
RENAMED
|
File without changes
|
|
File without changes
|
{starlette_admin-0.11.0.dev0 → starlette_admin-0.11.1}/starlette_admin/templates/forms/enum.html
RENAMED
|
File without changes
|
{starlette_admin-0.11.0.dev0 → starlette_admin-0.11.1}/starlette_admin/templates/forms/file.html
RENAMED
|
File without changes
|
{starlette_admin-0.11.0.dev0 → starlette_admin-0.11.1}/starlette_admin/templates/forms/image.html
RENAMED
|
File without changes
|
{starlette_admin-0.11.0.dev0 → starlette_admin-0.11.1}/starlette_admin/templates/forms/input.html
RENAMED
|
File without changes
|
{starlette_admin-0.11.0.dev0 → starlette_admin-0.11.1}/starlette_admin/templates/forms/json.html
RENAMED
|
File without changes
|
{starlette_admin-0.11.0.dev0 → starlette_admin-0.11.1}/starlette_admin/templates/forms/list.html
RENAMED
|
File without changes
|
{starlette_admin-0.11.0.dev0 → starlette_admin-0.11.1}/starlette_admin/templates/forms/relation.html
RENAMED
|
File without changes
|
{starlette_admin-0.11.0.dev0 → starlette_admin-0.11.1}/starlette_admin/templates/forms/tags.html
RENAMED
|
File without changes
|
{starlette_admin-0.11.0.dev0 → starlette_admin-0.11.1}/starlette_admin/templates/forms/textarea.html
RENAMED
|
File without changes
|
|
File without changes
|
{starlette_admin-0.11.0.dev0 → starlette_admin-0.11.1}/starlette_admin/templates/layout.html
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{starlette_admin-0.11.0.dev0 → starlette_admin-0.11.1}/starlette_admin/templates/macros/views.html
RENAMED
|
File without changes
|
{starlette_admin-0.11.0.dev0 → starlette_admin-0.11.1}/starlette_admin/templates/modals/actions.html
RENAMED
|
File without changes
|
{starlette_admin-0.11.0.dev0 → starlette_admin-0.11.1}/starlette_admin/templates/modals/delete.html
RENAMED
|
File without changes
|
{starlette_admin-0.11.0.dev0 → starlette_admin-0.11.1}/starlette_admin/templates/modals/error.html
RENAMED
|
File without changes
|
{starlette_admin-0.11.0.dev0 → starlette_admin-0.11.1}/starlette_admin/templates/modals/loading.html
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|