brilliance-admin 0.42.0__py3-none-any.whl → 0.43.1__py3-none-any.whl
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.
- {admin_panel → brilliance_admin}/__init__.py +2 -2
- brilliance_admin/api/routers.py +18 -0
- {admin_panel → brilliance_admin}/api/utils.py +1 -1
- {admin_panel → brilliance_admin}/api/views/auth.py +6 -6
- {admin_panel → brilliance_admin}/api/views/autocomplete.py +9 -9
- {admin_panel → brilliance_admin}/api/views/graphs.py +8 -8
- {admin_panel → brilliance_admin}/api/views/index.py +11 -4
- {admin_panel → brilliance_admin}/api/views/schema.py +3 -3
- {admin_panel → brilliance_admin}/api/views/settings.py +5 -5
- {admin_panel → brilliance_admin}/api/views/table.py +23 -23
- {admin_panel → brilliance_admin}/auth.py +1 -1
- {admin_panel → brilliance_admin}/exceptions.py +3 -4
- {admin_panel → brilliance_admin}/integrations/sqlalchemy/auth.py +4 -4
- {admin_panel → brilliance_admin}/integrations/sqlalchemy/autocomplete.py +4 -4
- {admin_panel → brilliance_admin}/integrations/sqlalchemy/fields.py +10 -10
- {admin_panel → brilliance_admin}/integrations/sqlalchemy/fields_schema.py +6 -6
- {admin_panel → brilliance_admin}/integrations/sqlalchemy/table/base.py +4 -4
- {admin_panel → brilliance_admin}/integrations/sqlalchemy/table/create.py +7 -7
- {admin_panel → brilliance_admin}/integrations/sqlalchemy/table/delete.py +3 -3
- {admin_panel → brilliance_admin}/integrations/sqlalchemy/table/list.py +7 -7
- {admin_panel → brilliance_admin}/integrations/sqlalchemy/table/retrieve.py +6 -6
- {admin_panel → brilliance_admin}/integrations/sqlalchemy/table/update.py +6 -6
- brilliance_admin/locales/en.yml +22 -0
- brilliance_admin/locales/ru.yml +22 -0
- {admin_panel → brilliance_admin}/schema/admin_schema.py +39 -31
- {admin_panel → brilliance_admin}/schema/category.py +8 -8
- {admin_panel → brilliance_admin}/schema/graphs/category_graphs.py +10 -9
- {admin_panel → brilliance_admin}/schema/group.py +10 -10
- {admin_panel → brilliance_admin}/schema/table/admin_action.py +8 -7
- {admin_panel → brilliance_admin}/schema/table/category_table.py +21 -21
- {admin_panel → brilliance_admin}/schema/table/fields/base.py +21 -21
- {admin_panel → brilliance_admin}/schema/table/fields/function_field.py +3 -3
- {admin_panel → brilliance_admin}/schema/table/fields_schema.py +9 -9
- {admin_panel → brilliance_admin}/schema/table/table_models.py +1 -1
- admin_panel/static/index-BeniOHDv.js → brilliance_admin/static/index-D9axz5zK.js +24 -24
- {admin_panel → brilliance_admin}/templates/index.html +1 -1
- brilliance_admin/translations.py +115 -0
- brilliance_admin/utils.py +153 -0
- brilliance_admin-0.43.1.dist-info/METADATA +214 -0
- brilliance_admin-0.43.1.dist-info/RECORD +74 -0
- brilliance_admin-0.43.1.dist-info/top_level.txt +1 -0
- admin_panel/api/routers.py +0 -18
- admin_panel/static/favicon.jpg +0 -0
- admin_panel/translations.py +0 -145
- admin_panel/utils.py +0 -50
- brilliance_admin-0.42.0.dist-info/METADATA +0 -155
- brilliance_admin-0.42.0.dist-info/RECORD +0 -73
- brilliance_admin-0.42.0.dist-info/top_level.txt +0 -1
- {admin_panel → brilliance_admin}/api/__init__.py +0 -0
- {admin_panel → brilliance_admin}/api/views/__init__.py +0 -0
- {admin_panel → brilliance_admin}/docs.py +0 -0
- {admin_panel → brilliance_admin}/integrations/__init__.py +0 -0
- {admin_panel → brilliance_admin}/integrations/sqlalchemy/__init__.py +0 -0
- {admin_panel → brilliance_admin}/integrations/sqlalchemy/table/__init__.py +0 -0
- {admin_panel → brilliance_admin}/schema/__init__.py +0 -0
- {admin_panel → brilliance_admin}/schema/graphs/__init__.py +0 -0
- {admin_panel → brilliance_admin}/schema/table/__init__.py +0 -0
- {admin_panel → brilliance_admin}/schema/table/fields/__init__.py +0 -0
- {admin_panel → brilliance_admin}/static/index-vlBToOhT.css +0 -0
- {admin_panel → brilliance_admin}/static/materialdesignicons-webfont-CYDMK1kx.woff2 +0 -0
- {admin_panel → brilliance_admin}/static/materialdesignicons-webfont-CgCzGbLl.woff +0 -0
- {admin_panel → brilliance_admin}/static/materialdesignicons-webfont-D3kAzl71.ttf +0 -0
- {admin_panel → brilliance_admin}/static/materialdesignicons-webfont-DttUABo4.eot +0 -0
- {admin_panel → brilliance_admin}/static/tinymce/dark-first/content.min.css +0 -0
- {admin_panel → brilliance_admin}/static/tinymce/dark-first/skin.min.css +0 -0
- {admin_panel → brilliance_admin}/static/tinymce/dark-slim/content.min.css +0 -0
- {admin_panel → brilliance_admin}/static/tinymce/dark-slim/skin.min.css +0 -0
- {admin_panel → brilliance_admin}/static/tinymce/img/example.png +0 -0
- {admin_panel → brilliance_admin}/static/tinymce/img/tinymce.woff2 +0 -0
- {admin_panel → brilliance_admin}/static/tinymce/lightgray/content.min.css +0 -0
- {admin_panel → brilliance_admin}/static/tinymce/lightgray/fonts/tinymce.woff +0 -0
- {admin_panel → brilliance_admin}/static/tinymce/lightgray/skin.min.css +0 -0
- {admin_panel → brilliance_admin}/static/tinymce/plugins/accordion/css/accordion.css +0 -0
- {admin_panel → brilliance_admin}/static/tinymce/plugins/accordion/plugin.js +0 -0
- {admin_panel → brilliance_admin}/static/tinymce/plugins/codesample/css/prism.css +0 -0
- {admin_panel → brilliance_admin}/static/tinymce/plugins/customLink/css/link.css +0 -0
- {admin_panel → brilliance_admin}/static/tinymce/plugins/customLink/plugin.js +0 -0
- {admin_panel → brilliance_admin}/static/tinymce/tinymce.min.js +0 -0
- {admin_panel → brilliance_admin}/static/vanilla-picker-B6E6ObS_.js +0 -0
- {brilliance_admin-0.42.0.dist-info → brilliance_admin-0.43.1.dist-info}/WHEEL +0 -0
- {brilliance_admin-0.42.0.dist-info → brilliance_admin-0.43.1.dist-info}/licenses/LICENSE +0 -0
admin_panel/translations.py
DELETED
|
@@ -1,145 +0,0 @@
|
|
|
1
|
-
import abc
|
|
2
|
-
from typing import ClassVar, Dict
|
|
3
|
-
|
|
4
|
-
import pydantic
|
|
5
|
-
from asgiref.local import Local
|
|
6
|
-
|
|
7
|
-
from admin_panel.utils import DataclassBase
|
|
8
|
-
|
|
9
|
-
_active = Local()
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
@pydantic.dataclasses.dataclass
|
|
13
|
-
class TranslateText(DataclassBase):
|
|
14
|
-
slug: str
|
|
15
|
-
translation_kwargs: dict | None = None
|
|
16
|
-
|
|
17
|
-
def __init__(self, slug: str):
|
|
18
|
-
self.slug = slug
|
|
19
|
-
|
|
20
|
-
@pydantic.model_serializer(mode='plain')
|
|
21
|
-
def serialize_model(self, info: pydantic.SerializationInfo) -> str:
|
|
22
|
-
ctx = info.context or {}
|
|
23
|
-
language_manager = ctx.get('language_manager')
|
|
24
|
-
|
|
25
|
-
if not language_manager:
|
|
26
|
-
raise AttributeError('language_manager is not in context manager for serialization')
|
|
27
|
-
|
|
28
|
-
if not issubclass(type(language_manager), LanguageManager):
|
|
29
|
-
raise AttributeError(f'language_manager "{type(language_manager)}" is not subclass of LanguageManager')
|
|
30
|
-
|
|
31
|
-
return language_manager.get_text(self)
|
|
32
|
-
|
|
33
|
-
def __str__(self):
|
|
34
|
-
lm = getattr(_active, '_language_manager', None)
|
|
35
|
-
if not lm:
|
|
36
|
-
|
|
37
|
-
raise AttributeError(f'language_manager is not in local scope for translation: {locals()}')
|
|
38
|
-
|
|
39
|
-
if not issubclass(type(lm), LanguageManager):
|
|
40
|
-
raise AttributeError(f'language_manager "{lm}" is not subclass of LanguageManager')
|
|
41
|
-
|
|
42
|
-
return lm.get_text(self)
|
|
43
|
-
|
|
44
|
-
def __mod__(self, other):
|
|
45
|
-
if not isinstance(other, dict):
|
|
46
|
-
msg = f'TranslateText only dict is supported trough % operand (slug="{self.slug}" other={type(other)})'
|
|
47
|
-
raise AttributeError(msg)
|
|
48
|
-
self.translation_kwargs = other
|
|
49
|
-
return self
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
SQLALCHEMY_SEARCH_HELP_RU = '''<b>Доступные поля для поиска:</b>
|
|
53
|
-
%(fields)s
|
|
54
|
-
|
|
55
|
-
<b>Доступные операторы:</b>
|
|
56
|
-
<b>""</b> - кавычки для точного совпадения
|
|
57
|
-
<b>%%</b> - любая последовательность символов
|
|
58
|
-
<b>_</b> - один любой символ
|
|
59
|
-
'''
|
|
60
|
-
sqlalchemy_search_help_EN = '''<b>Available search fields:</b>
|
|
61
|
-
%(fields)s
|
|
62
|
-
|
|
63
|
-
<b>Available operators:</b>
|
|
64
|
-
<b>""</b> - quotes for exact match
|
|
65
|
-
<b>%%</b> - any sequence of characters
|
|
66
|
-
<b>_</b> - any single character
|
|
67
|
-
'''
|
|
68
|
-
|
|
69
|
-
DEFAULT_PHRASES = {
|
|
70
|
-
'ru': {
|
|
71
|
-
'delete': 'Удалить',
|
|
72
|
-
'delete_confirmation_text': 'Вы уверены, что хотите удалить данные записи?\nДанное действие нельзя отменить.',
|
|
73
|
-
'deleted_successfully': 'Записи успешно удалены.',
|
|
74
|
-
'pk_not_found': 'Поле "%(pk_name)s" не найдено среди переданных данных.',
|
|
75
|
-
'record_not_found': 'Запись по ключу %(pk_name)s=%(pk)s не найдена.',
|
|
76
|
-
'db_error_create': 'Ошибка создания записи в базе данных.',
|
|
77
|
-
'db_error_update': 'Ошибка обновления записи в базе данных.',
|
|
78
|
-
'db_error_retrieve': 'Ошибка получения записи из базы данных.',
|
|
79
|
-
'db_error_list': 'Ошибка получения данных таблицы из базы данных.',
|
|
80
|
-
'connection_refused_error': 'Ошибка подключения к базе данных: %(error)s',
|
|
81
|
-
'search_help': 'Доступные поля для поиска: %(fields)s',
|
|
82
|
-
'sqlalchemy_search_help': SQLALCHEMY_SEARCH_HELP_RU,
|
|
83
|
-
'filters_exception': 'Произошла неизвестная техническая ошибка при фильтрации данных.',
|
|
84
|
-
'method_not_allowed': 'Ошибка, данный метод недоступен.',
|
|
85
|
-
'filter_error': 'Проишла ошибка при фильтрации: {error}',
|
|
86
|
-
},
|
|
87
|
-
'en': {
|
|
88
|
-
'delete': 'Delete',
|
|
89
|
-
'delete_confirmation_text': 'Are you sure you want to delete those records?\nThis action cannot be undone.',
|
|
90
|
-
'deleted_successfully': 'The entries were successfully deleted.',
|
|
91
|
-
'pk_not_found': 'The "%(pk_name)s" field was not found in the submitted data.',
|
|
92
|
-
'record_not_found': 'No record found for %(pk_name)s=%(pk)s.',
|
|
93
|
-
'db_error_update': 'Error updating the record in the database.',
|
|
94
|
-
'db_error_create': 'Error creating a record in the database.',
|
|
95
|
-
'db_error_retrieve': 'Error retrieving the record from the database.',
|
|
96
|
-
'db_error_list': 'Failed to retrieve table data from the database.',
|
|
97
|
-
'connection_refused_error': 'Database connection error: %(error)s',
|
|
98
|
-
'search_help': 'Available search fields: %(fields)s',
|
|
99
|
-
'sqlalchemy_search_help': sqlalchemy_search_help_EN,
|
|
100
|
-
'filters_exception': 'An unknown technical error occurred while filtering data.',
|
|
101
|
-
'method_not_allowed': 'Error, method not allowed. This action is not permitted.',
|
|
102
|
-
'filter_error': 'An error occurred during filtering: {error}',
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
def merge_phrases(base: dict[str, dict[str, str]], extra: dict[str, dict[str, str]]) -> dict[str, dict[str, str]]:
|
|
108
|
-
merged = {lang: phrases.copy() for lang, phrases in base.items()}
|
|
109
|
-
|
|
110
|
-
for lang, phrases in extra.items():
|
|
111
|
-
if lang in merged:
|
|
112
|
-
merged[lang].update(phrases)
|
|
113
|
-
|
|
114
|
-
return merged
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
class LanguageManager(abc.ABC):
|
|
118
|
-
language: str | None
|
|
119
|
-
|
|
120
|
-
languages: ClassVar[Dict[str, str | TranslateText] | None] = None
|
|
121
|
-
languages_phrases: ClassVar[dict | None] = None
|
|
122
|
-
|
|
123
|
-
def __init__(self, language: str | None):
|
|
124
|
-
self.language = language
|
|
125
|
-
_active._language_manager = self
|
|
126
|
-
|
|
127
|
-
if not self.languages_phrases:
|
|
128
|
-
self.languages_phrases = {}
|
|
129
|
-
|
|
130
|
-
self.languages_phrases = merge_phrases(self.languages_phrases, DEFAULT_PHRASES)
|
|
131
|
-
|
|
132
|
-
def get_text(self, text) -> str:
|
|
133
|
-
if self.languages_phrases and isinstance(text, TranslateText):
|
|
134
|
-
default_lang = list(self.languages_phrases.keys())[0]
|
|
135
|
-
|
|
136
|
-
phrases = self.languages_phrases.get(self.language or default_lang)
|
|
137
|
-
if not phrases:
|
|
138
|
-
phrases = self.languages_phrases[default_lang]
|
|
139
|
-
|
|
140
|
-
translation = phrases.get(text.slug) or text.slug
|
|
141
|
-
if text.translation_kwargs:
|
|
142
|
-
translation %= text.translation_kwargs
|
|
143
|
-
return translation
|
|
144
|
-
|
|
145
|
-
return text
|
admin_panel/utils.py
DELETED
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import logging
|
|
2
|
-
import re
|
|
3
|
-
|
|
4
|
-
from pydantic import TypeAdapter
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
def get_logger():
|
|
8
|
-
try:
|
|
9
|
-
# pylint: disable=import-outside-toplevel
|
|
10
|
-
import structlog
|
|
11
|
-
return structlog.get_logger('admin_panel')
|
|
12
|
-
except ImportError:
|
|
13
|
-
return logging.getLogger('admin_panel')
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
class DeserializeAction:
|
|
17
|
-
CREATE = 0
|
|
18
|
-
UPDATE = 1
|
|
19
|
-
TABLE_ACTION = 2
|
|
20
|
-
FILTERS = 3
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
class DataclassBase:
|
|
24
|
-
def model_dump(self, *args, **kwargs) -> dict:
|
|
25
|
-
adapter = TypeAdapter(type(self))
|
|
26
|
-
return adapter.dump_python(self, *args, **kwargs)
|
|
27
|
-
|
|
28
|
-
def to_dict(self, keep_none=True) -> dict:
|
|
29
|
-
data = self.model_dump()
|
|
30
|
-
return {
|
|
31
|
-
k: v for k, v in data.items()
|
|
32
|
-
if v is not None and not keep_none
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
def humanize_field_name(name: str) -> str:
|
|
37
|
-
# Convert snake_case / kebab-case / mixed tokens to Title Case with acronyms preserved
|
|
38
|
-
s = name.replace("-", "_")
|
|
39
|
-
parts = [p for p in s.split("_") if p]
|
|
40
|
-
|
|
41
|
-
def cap(token: str) -> str:
|
|
42
|
-
# Keep common acronyms uppercase
|
|
43
|
-
if token.lower() in {"id", "ip", "url", "api", "http", "https", "h2h"}:
|
|
44
|
-
return token.upper()
|
|
45
|
-
# If token contains digits, capitalize first letter only (e.g. "h2h" -> "H2h")
|
|
46
|
-
if re.search(r"\d", token):
|
|
47
|
-
return token[:1].upper() + token[1:].lower()
|
|
48
|
-
return token[:1].upper() + token[1:].lower()
|
|
49
|
-
|
|
50
|
-
return " ".join(cap(p) for p in parts)
|
|
@@ -1,155 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.4
|
|
2
|
-
Name: brilliance-admin
|
|
3
|
-
Version: 0.42.0
|
|
4
|
-
Summary: General-purpose admin panel framework powered by FastAPI. Some call it heavenly in its brilliance.
|
|
5
|
-
License-Expression: AGPL-3.0
|
|
6
|
-
Requires-Python: >=3.10
|
|
7
|
-
Description-Content-Type: text/markdown
|
|
8
|
-
License-File: LICENSE
|
|
9
|
-
Requires-Dist: asgiref>=3.11.0
|
|
10
|
-
Requires-Dist: fastapi>=0.115.8
|
|
11
|
-
Requires-Dist: jinja2>=3.1.6
|
|
12
|
-
Provides-Extra: example
|
|
13
|
-
Requires-Dist: uvicorn>=0.34.0; extra == "example"
|
|
14
|
-
Requires-Dist: faker>=38.2.0; extra == "example"
|
|
15
|
-
Requires-Dist: pyjwt>=2.10.1; extra == "example"
|
|
16
|
-
Requires-Dist: structlog>=25.5.0; extra == "example"
|
|
17
|
-
Requires-Dist: rich>=14.2.0; extra == "example"
|
|
18
|
-
Provides-Extra: tests
|
|
19
|
-
Requires-Dist: pytest>=8.4.2; extra == "tests"
|
|
20
|
-
Requires-Dist: pytest-asyncio>=1.2.0; extra == "tests"
|
|
21
|
-
Requires-Dist: httpx>=0.28.1; extra == "tests"
|
|
22
|
-
Requires-Dist: pytest-mock>=3.15.1; extra == "tests"
|
|
23
|
-
Requires-Dist: sqlalchemy>=2.0.41; extra == "tests"
|
|
24
|
-
Requires-Dist: aiosqlite>=0.22.1; extra == "tests"
|
|
25
|
-
Requires-Dist: factory-boy>=3.3.3; extra == "tests"
|
|
26
|
-
Requires-Dist: pyjwt>=2.10.1; extra == "tests"
|
|
27
|
-
Provides-Extra: scalar
|
|
28
|
-
Requires-Dist: scalar-fastapi>=1.5.0; extra == "scalar"
|
|
29
|
-
Dynamic: license-file
|
|
30
|
-
|
|
31
|
-
<div align="center">
|
|
32
|
-
<img src="https://github.com/brilliance-admin/backend-python/blob/main/example/static/logo-outline.png?raw=true"
|
|
33
|
-
alt="Brilliance Admin"
|
|
34
|
-
width="600">
|
|
35
|
-
</div>
|
|
36
|
-
|
|
37
|
-
<div align="center">
|
|
38
|
-
|
|
39
|
-
[](https://pypi.org/project/brilliance-admin/)
|
|
40
|
-
[](https://github.com/brilliance-admin/backend-python/blob/main/LICENSE)
|
|
41
|
-
[](https://github.com/brilliance-admin/backend-python/actions)
|
|
42
|
-
|
|
43
|
-
</div>
|
|
44
|
-
|
|
45
|
-
General-purpose admin panel framework powered by FastAPI. Some call it heavenly in its brilliance.
|
|
46
|
-
|
|
47
|
-
- Serves a prebuilt SPA frontend as static files
|
|
48
|
-
- Generates schemas for frontend sections on the backend
|
|
49
|
-
- Provides a backend-driven API for admin interfaces
|
|
50
|
-
- Designed for fast data management and data viewing from any sources
|
|
51
|
-
- Inspired by Django Admin and Django REST Framework
|
|
52
|
-
- Focused on minimal boilerplate and simplified backend-controlled configuration
|
|
53
|
-
|
|
54
|
-
### [Live Demo](https://brilliance-admin.com/) | [Example App](https://github.com/brilliance-admin/backend-python/tree/main/example) | Documentation (todo)
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
### Features:
|
|
58
|
-
|
|
59
|
-
* Tables with full CRUD support, including filtering, sorting, and pagination.
|
|
60
|
-
* Ability to define custom table actions with forms, response messages, and file uploads.
|
|
61
|
-
* SQLAlchemy integration with automatic field generation from models.
|
|
62
|
-
* Authorization via any account data source.
|
|
63
|
-
* Localization support with language selection in the interface.
|
|
64
|
-
|
|
65
|
-
## How to use it
|
|
66
|
-
|
|
67
|
-
Installation:
|
|
68
|
-
``` shell
|
|
69
|
-
pip install brilliance-admin
|
|
70
|
-
```
|
|
71
|
-
|
|
72
|
-
You need to generate `AdminSchema` instance:
|
|
73
|
-
``` python
|
|
74
|
-
from admin_panel import schema
|
|
75
|
-
|
|
76
|
-
admin_schema = schema.AdminSchema(
|
|
77
|
-
title='Admin Panel',
|
|
78
|
-
auth=YourAdminAuthentication(),
|
|
79
|
-
groups=[
|
|
80
|
-
schema.Group(
|
|
81
|
-
slug='example',
|
|
82
|
-
title='Example',
|
|
83
|
-
icon='mdi-star',
|
|
84
|
-
categories=[
|
|
85
|
-
CategoryExample(),
|
|
86
|
-
]
|
|
87
|
-
),
|
|
88
|
-
],
|
|
89
|
-
)
|
|
90
|
-
|
|
91
|
-
admin_app = admin_schema.generate_app()
|
|
92
|
-
|
|
93
|
-
# Your FastAPI app
|
|
94
|
-
app = FastAPI()
|
|
95
|
-
app.mount('/admin', admin_app)
|
|
96
|
-
```
|
|
97
|
-
|
|
98
|
-
### SQLAlchemy integration
|
|
99
|
-
Brilliance Admin supports automatic schema generation from SQLAlchemy and provides a ready-made CRUD implementation for tables.
|
|
100
|
-
|
|
101
|
-
``` python
|
|
102
|
-
from admin_panel import sqlalchemy
|
|
103
|
-
from admin_panel.translations import TranslateText as _
|
|
104
|
-
|
|
105
|
-
from your_project.models import Terminal
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
class TerminalAdmin(sqlalchemy.SQLAlchemyAdmin):
|
|
109
|
-
db_async_session = async_sessionmaker
|
|
110
|
-
model = Terminal
|
|
111
|
-
title = _('terminals')
|
|
112
|
-
icon = 'mdi-console-network-outline'
|
|
113
|
-
|
|
114
|
-
ordering_fields = ['id']
|
|
115
|
-
search_fields = ['id', 'title']
|
|
116
|
-
|
|
117
|
-
table_schema = sqlalchemy.SQLAlchemyFieldsSchema(
|
|
118
|
-
model=Terminal,
|
|
119
|
-
list_display=['id', 'merchant_id'],
|
|
120
|
-
)
|
|
121
|
-
table_filters = sqlalchemy.SQLAlchemyFieldsSchema(
|
|
122
|
-
model=Terminal,
|
|
123
|
-
fields=['id', 'created_at'],
|
|
124
|
-
created_at=schema.DateTimeField(range=True),
|
|
125
|
-
)
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
category = TerminalAdmin()
|
|
129
|
-
```
|
|
130
|
-
|
|
131
|
-
Now, the `TerminalAdmin` instance can be passed to `categories`.
|
|
132
|
-
|
|
133
|
-
### Can be used both via inheritance and instancing
|
|
134
|
-
|
|
135
|
-
For `SQLAlchemyFieldsSchema`
|
|
136
|
-
|
|
137
|
-
``` python
|
|
138
|
-
class TerminalTableSchema(sqlalchemy.SQLAlchemyFieldsSchema):
|
|
139
|
-
model = Terminal
|
|
140
|
-
fields = ['id', 'created_at']
|
|
141
|
-
|
|
142
|
-
created_at=schema.DateTimeField(range=True)
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
class TerminalAdmin(sqlalchemy.SQLAlchemyAdmin):
|
|
146
|
-
table_schema = TerminalTableSchema()
|
|
147
|
-
```
|
|
148
|
-
|
|
149
|
-
And `SQLAlchemyAdmin` category schema itself
|
|
150
|
-
|
|
151
|
-
> If `table_schema` is not specified, it will be generated automatically and will include all discovered fields and relationships of the table in the output.
|
|
152
|
-
|
|
153
|
-
``` python
|
|
154
|
-
category = sqlalchemy.SQLAlchemyAdmin(db_async_session=async_sessionmaker, model=Terminal)
|
|
155
|
-
```
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
admin_panel/__init__.py,sha256=uvAJW6E2Sjmsk7PzicJ3vywgjeEq_irxlnxGOwbHOIk,173
|
|
2
|
-
admin_panel/auth.py,sha256=XYqcSqUVXqkqON4bASMXPYsJY-rbOU-D7QzI2k1CXek,668
|
|
3
|
-
admin_panel/docs.py,sha256=fKeJKuiCCi1jHRmNcmkuDD6_2di7bwc6-w8V1VCTu0s,1231
|
|
4
|
-
admin_panel/exceptions.py,sha256=klGOg64g0NQoc8KTdMhN94o5NbGGjURiJpoWFzHj1qU,962
|
|
5
|
-
admin_panel/translations.py,sha256=fh60w2MfC4Aqq_rV33Y9SGUHPpoAMtOI1eZu5iAqpp4,6211
|
|
6
|
-
admin_panel/utils.py,sha256=5mnwSiaMTbqGDTXTGmcoRf15uKw7oeJDKBI67O2Ruvk,1425
|
|
7
|
-
admin_panel/api/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
8
|
-
admin_panel/api/routers.py,sha256=j86iF7TnHeBGA1CfLQTECgHEtyoHq3qBOrqTu3M8rFs,770
|
|
9
|
-
admin_panel/api/utils.py,sha256=TBktoVG2xmCftfd40XC84nb0F_yYLsw51Bvv8spn17g,994
|
|
10
|
-
admin_panel/api/views/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
11
|
-
admin_panel/api/views/auth.py,sha256=CAcSSBEksY5CCYbOZa22IpKYqnOOgxopFvGZveYBxSg,1113
|
|
12
|
-
admin_panel/api/views/autocomplete.py,sha256=0Hh63P3aEmAc4l9sRLbBIVI2fbb3YH7purGjTtNC1CM,1478
|
|
13
|
-
admin_panel/api/views/graphs.py,sha256=ZiwgJSSUCARBRXgGZI8ha3h74mZSGbS40SDsBsTWftM,1321
|
|
14
|
-
admin_panel/api/views/index.py,sha256=Q3pgBwCLwwdolWQp6Pmc0Cexc2FfQQGu6TaNOLFyLp4,1233
|
|
15
|
-
admin_panel/api/views/schema.py,sha256=NdutSK4ydidJtegaOvdoK1-W8Mk2xzf6vtB0Nwq7uPg,1004
|
|
16
|
-
admin_panel/api/views/settings.py,sha256=k2QyHfEIT9EBXQ2R7nDfNhhCSShOIPNO2Sd6dTRviQc,1151
|
|
17
|
-
admin_panel/api/views/table.py,sha256=5VjD0Ss2leGmUa37bUaSafr97gwXxy4ZGJZKwR-5qJo,5892
|
|
18
|
-
admin_panel/integrations/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
19
|
-
admin_panel/integrations/sqlalchemy/__init__.py,sha256=tIegMU2eIW_zA-PdblCXCjenHAY4sGBUWKuz97ns4gE,275
|
|
20
|
-
admin_panel/integrations/sqlalchemy/auth.py,sha256=EJmNNEpsjROnTgL1q304_i6Al3a2lKSmQh7YUzRcl5w,4890
|
|
21
|
-
admin_panel/integrations/sqlalchemy/autocomplete.py,sha256=ao2WgJ10tlegizLUMHaoz0225BCX6hRGARAZDP0O67I,1401
|
|
22
|
-
admin_panel/integrations/sqlalchemy/fields.py,sha256=tlxsBlRAMeL9IzXG445FrAxws49wu7-VYtMuTp2oGXY,9372
|
|
23
|
-
admin_panel/integrations/sqlalchemy/fields_schema.py,sha256=raEd2zFseQHpdJS8SqYcOcTk1pNq7g0zwYdpwwHmFBg,10884
|
|
24
|
-
admin_panel/integrations/sqlalchemy/table/__init__.py,sha256=g_in2pLTi8UQnT5uNFA8mLW5mxlT84irQ7yVaP_OSS4,605
|
|
25
|
-
admin_panel/integrations/sqlalchemy/table/base.py,sha256=r8LtEZH5AhIVRsi2AcrJ8kQWk8qAUSCLDmOXNAn4qnE,4853
|
|
26
|
-
admin_panel/integrations/sqlalchemy/table/create.py,sha256=qjdfqC4KP7Ktxz_I2M7xm-8nRyvsmcqXw4QESO1trs0,2663
|
|
27
|
-
admin_panel/integrations/sqlalchemy/table/delete.py,sha256=2MJ-gE0yRTRwQRKNuXIL78tiZscu_2qzs7sqyOIlHok,716
|
|
28
|
-
admin_panel/integrations/sqlalchemy/table/list.py,sha256=80wl9Ja1_Dc6p_6zTi-trxg0Rq69YCJ9_4dJvcyTJZw,6662
|
|
29
|
-
admin_panel/integrations/sqlalchemy/table/retrieve.py,sha256=kuHyMGvJhTlWyHuB1wXNl6HelAkMzQjhcMGZwOHtSK0,2115
|
|
30
|
-
admin_panel/integrations/sqlalchemy/table/update.py,sha256=O1hpzEP04tUv_HUD8ChCBqYbjjnrRc2houvJbNUYEzY,3518
|
|
31
|
-
admin_panel/schema/__init__.py,sha256=X-izShvv84jkFU47WfpUwtvRh3NOv570iUB3NRNEIDU,248
|
|
32
|
-
admin_panel/schema/admin_schema.py,sha256=_bQmDTnBzq_uxEAgQ-Dqra5rTewtaLY_HboB3__n80o,6224
|
|
33
|
-
admin_panel/schema/category.py,sha256=ph7rndUK21lxRDToYpcYnvIyfGwPP-HESST7DxObdqU,4108
|
|
34
|
-
admin_panel/schema/group.py,sha256=h4AuiGEsy3yE1Oz5YlJ6lOhDEzIgi4WgtmLZ4JRgrgg,2238
|
|
35
|
-
admin_panel/schema/graphs/__init__.py,sha256=qvmZv9QWdiutPtN5VYQLYbsjY2SOg8p_XRaz2rUlIxY,44
|
|
36
|
-
admin_panel/schema/graphs/category_graphs.py,sha256=KlJhnMTT9fNKSJqqMea9WpIHSnWuuG-usnyMoVIEPrM,1469
|
|
37
|
-
admin_panel/schema/table/__init__.py,sha256=vuRw8HBuak2LaTZi2dNn5YOrJPalQps-O3Ht-d0AZV4,378
|
|
38
|
-
admin_panel/schema/table/admin_action.py,sha256=wDDvJSr8f4jvCgf2DHmBUMZTFdNIdSQ8EZtBOG-FhC0,2016
|
|
39
|
-
admin_panel/schema/table/category_table.py,sha256=wGU1-n4_DvZLLfJaDXjcwPKdnfXH4oYU_L0RCXgp3f0,6414
|
|
40
|
-
admin_panel/schema/table/fields_schema.py,sha256=fmRG7chuvSl94Zw-oN1ljqsan9sGbGPHN_KVnCfi8UI,8241
|
|
41
|
-
admin_panel/schema/table/table_models.py,sha256=7UQyqZcA-2sz0731EAkvhPKDuZbxCqUTrdykWZdxyvc,1013
|
|
42
|
-
admin_panel/schema/table/fields/__init__.py,sha256=RW-sIFTAaSQo4mMR6iWtnefogWPjmg6KAsDwe9mKW1k,291
|
|
43
|
-
admin_panel/schema/table/fields/base.py,sha256=Po4M04oF4OuPFqYRH28SlIpH8C3BEBlGuaR_K6MdFRs,7789
|
|
44
|
-
admin_panel/schema/table/fields/function_field.py,sha256=MlPCHtc10-WWcnZ0jX7rGoTr6mG1HhloAKW_cB69GAI,1765
|
|
45
|
-
admin_panel/static/favicon.jpg,sha256=_np-jvdgK1qgkqbbz9yecZ-PoR4iMwltHthQ2gYebYk,12991
|
|
46
|
-
admin_panel/static/index-BeniOHDv.js,sha256=U5N_dXe2QOlSKVVwJ0Ghu8hNIiBD9QF-bK_04MAgucc,3201882
|
|
47
|
-
admin_panel/static/index-vlBToOhT.css,sha256=hoVCpcStTHdAVRm37k1umrNdXjOwIIveu9lxk4ocpEc,983028
|
|
48
|
-
admin_panel/static/materialdesignicons-webfont-CYDMK1kx.woff2,sha256=5S1g9kJnzaoIQitQurXUW9NeZisDua91F5zq4ArF_Is,385360
|
|
49
|
-
admin_panel/static/materialdesignicons-webfont-CgCzGbLl.woff,sha256=SNPuxqtw3HoZCPm6LyCOClhxi57hbj9qvbXbT0Yfolg,561776
|
|
50
|
-
admin_panel/static/materialdesignicons-webfont-D3kAzl71.ttf,sha256=vXJaejiTnltZkE4benJlkZ7OwlYWbs5p1RXCEAUWWQc,1243500
|
|
51
|
-
admin_panel/static/materialdesignicons-webfont-DttUABo4.eot,sha256=hhrqBUjMya-Y3sUgvjQLji1L65e6NIk6ya9RGkSeP6I,1243720
|
|
52
|
-
admin_panel/static/vanilla-picker-B6E6ObS_.js,sha256=aVVU5PLkFXbK22gMndNsa5QNWtZxQBEqtd2Fp8HYfwE,18804
|
|
53
|
-
admin_panel/static/tinymce/tinymce.min.js,sha256=4KlST3LusLGTHzCqhWmoENGfb4aeSvmj9IlL-v6ATeg,1171290
|
|
54
|
-
admin_panel/static/tinymce/dark-first/content.min.css,sha256=tCWU8dU3Y4eejwO9fjZ22eIwrq8q5iFSlyR8FlQ8-dU,4788
|
|
55
|
-
admin_panel/static/tinymce/dark-first/skin.min.css,sha256=XaCMxHAKdwqA0HyM2l_vvA1KRwhOC7bbX3Bz2z0f1jw,50376
|
|
56
|
-
admin_panel/static/tinymce/dark-slim/content.min.css,sha256=fyLDj0yRBtk8ypK6LL3aI2PHyH6x7ISDncpbHOuvwPI,4730
|
|
57
|
-
admin_panel/static/tinymce/dark-slim/skin.min.css,sha256=tzEwzhO0ToVn_l1AkBRK6vwz9dSqjEpQbTNao12Kqy0,49965
|
|
58
|
-
admin_panel/static/tinymce/img/example.png,sha256=R18xquUdQyQvA6dFZUIXkLucVO2mMJpgV1oHI4cFQJ0,14708
|
|
59
|
-
admin_panel/static/tinymce/img/tinymce.woff2,sha256=_XmHMFsFYH9PlgREy6LOzYYFgvs2fGIMcr2vXt2Q-ik,15764
|
|
60
|
-
admin_panel/static/tinymce/lightgray/content.min.css,sha256=UgkDCoTokZ99doSjtoycaZAZVjO00I1XikWjBpWf9NI,3193
|
|
61
|
-
admin_panel/static/tinymce/lightgray/skin.min.css,sha256=ypP9oqgJwhKl2-B_ATE6uC77pqPjVYP6vz7EzBuiiSU,38232
|
|
62
|
-
admin_panel/static/tinymce/lightgray/fonts/tinymce.woff,sha256=o69L1waoOPHkqgihbpfjT_qTB8PJsZJeJTR7aL8IH8M,7664
|
|
63
|
-
admin_panel/static/tinymce/plugins/accordion/plugin.js,sha256=jf3gA0MkE2Gshhe8pTJP5JUVI56G3YlBZQSoevPWeuc,1251
|
|
64
|
-
admin_panel/static/tinymce/plugins/accordion/css/accordion.css,sha256=u5UQkMNA9fboQgOOuJCgoJ3Dm-9vDYDJDAmpPbB-yWM,282
|
|
65
|
-
admin_panel/static/tinymce/plugins/codesample/css/prism.css,sha256=exAdMtHbvwW7-DEs567MX65Fq1aJQTfREP5pw8gW-AY,1736
|
|
66
|
-
admin_panel/static/tinymce/plugins/customLink/plugin.js,sha256=illBNpnHDkBsLG6wo_jDPF6z7CGnO1MQWUoDwZKy6vQ,5589
|
|
67
|
-
admin_panel/static/tinymce/plugins/customLink/css/link.css,sha256=gh5nvY8Z92hJfCEBPnIm4jIPCcKKbJnab-30oIfX7Hc,56
|
|
68
|
-
admin_panel/templates/index.html,sha256=7a3DWqQxaHhm0_NfPmae5D55rRKPkrZx8fmsvDaxy8Y,1294
|
|
69
|
-
brilliance_admin-0.42.0.dist-info/licenses/LICENSE,sha256=PjeDRXGbVLtKul5Xpfco_6CyB6bYGWVVPrO0oubquuM,727
|
|
70
|
-
brilliance_admin-0.42.0.dist-info/METADATA,sha256=kGlOILv4XWlso252it6QiogEp9XtOco_2i_N0NlXj2M,4996
|
|
71
|
-
brilliance_admin-0.42.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
72
|
-
brilliance_admin-0.42.0.dist-info/top_level.txt,sha256=saSuhWhjU9d5_tZnnBG6GYVQY7ywThehjbEePImWik8,12
|
|
73
|
-
brilliance_admin-0.42.0.dist-info/RECORD,,
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
admin_panel
|
|
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
|
|
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
|