adminA 2024.6.29.11__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.
Potentially problematic release.
This version of adminA might be problematic. Click here for more details.
- admina-2024.6.29.11/LICENSE +19 -0
- admina-2024.6.29.11/PKG-INFO +21 -0
- admina-2024.6.29.11/README.md +7 -0
- admina-2024.6.29.11/pyproject.toml +23 -0
- admina-2024.6.29.11/setup.cfg +4 -0
- admina-2024.6.29.11/src/adminA/__init__.py +0 -0
- admina-2024.6.29.11/src/adminA/example.py +2 -0
- admina-2024.6.29.11/src/adminA/migrations/0001_initial.py +25 -0
- admina-2024.6.29.11/src/adminA/migrations/__init__.py +0 -0
- admina-2024.6.29.11/src/adminA/models.py +10 -0
- admina-2024.6.29.11/src/adminA/serializers.py +9 -0
- admina-2024.6.29.11/src/adminA/urls.py +17 -0
- admina-2024.6.29.11/src/adminA/views.py +55 -0
- admina-2024.6.29.11/src/adminA.egg-info/PKG-INFO +21 -0
- admina-2024.6.29.11/src/adminA.egg-info/SOURCES.txt +15 -0
- admina-2024.6.29.11/src/adminA.egg-info/dependency_links.txt +1 -0
- admina-2024.6.29.11/src/adminA.egg-info/top_level.txt +1 -0
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
Copyright (c) Github Author yanchengxin2018
|
|
2
|
+
|
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
4
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
5
|
+
in the Software without restriction, including without limitation the rights
|
|
6
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
7
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
8
|
+
furnished to do so, subject to the following conditions:
|
|
9
|
+
|
|
10
|
+
The above copyright notice and this permission notice shall be included in all
|
|
11
|
+
copies or substantial portions of the Software.
|
|
12
|
+
|
|
13
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
14
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
15
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
16
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
17
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
18
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
19
|
+
SOFTWARE.
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: adminA
|
|
3
|
+
Version: 2024.6.29.11
|
|
4
|
+
Summary: 为django应用提供快速的管理员页面构建.使用drf及0代码操作提供更快捷的admin页面构建.
|
|
5
|
+
Author-email: YanChengxin <yan.cheng.xin@foxmail.com>
|
|
6
|
+
Project-URL: Homepage, https://github.com/pypa/sampleproject
|
|
7
|
+
Project-URL: Issues, https://github.com/pypa/sampleproject/issues
|
|
8
|
+
Classifier: Programming Language :: Python :: 3
|
|
9
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
10
|
+
Classifier: Operating System :: OS Independent
|
|
11
|
+
Requires-Python: >=3.8
|
|
12
|
+
Description-Content-Type: text/markdown
|
|
13
|
+
License-File: LICENSE
|
|
14
|
+
|
|
15
|
+
功能:为django应用提供快速的管理员页面构建
|
|
16
|
+
用法:安装pip install adminA
|
|
17
|
+
待补充
|
|
18
|
+
项目开发中,目前还不能用
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=61.0"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "adminA"
|
|
7
|
+
version = "2024.6.29.11"
|
|
8
|
+
authors = [
|
|
9
|
+
{ name="YanChengxin", email="yan.cheng.xin@foxmail.com" },
|
|
10
|
+
]
|
|
11
|
+
description = "为django应用提供快速的管理员页面构建.使用drf及0代码操作提供更快捷的admin页面构建."
|
|
12
|
+
readme = "README.md"
|
|
13
|
+
requires-python = ">=3.8"
|
|
14
|
+
classifiers = [
|
|
15
|
+
"Programming Language :: Python :: 3",
|
|
16
|
+
"License :: OSI Approved :: MIT License",
|
|
17
|
+
"Operating System :: OS Independent",
|
|
18
|
+
]
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
[project.urls]
|
|
22
|
+
Homepage = "https://github.com/pypa/sampleproject"
|
|
23
|
+
Issues = "https://github.com/pypa/sampleproject/issues"
|
|
File without changes
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# Generated by Django 4.2.1 on 2024-06-29 07:56
|
|
2
|
+
|
|
3
|
+
from django.db import migrations, models
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class Migration(migrations.Migration):
|
|
7
|
+
|
|
8
|
+
initial = True
|
|
9
|
+
|
|
10
|
+
dependencies = [
|
|
11
|
+
]
|
|
12
|
+
|
|
13
|
+
operations = [
|
|
14
|
+
migrations.CreateModel(
|
|
15
|
+
name='AdminAConfModel',
|
|
16
|
+
fields=[
|
|
17
|
+
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
|
18
|
+
('created_at', models.DateTimeField(auto_now_add=True)),
|
|
19
|
+
('updated_at', models.DateTimeField(auto_now=True)),
|
|
20
|
+
('code', models.CharField(help_text='项目代码', max_length=100)),
|
|
21
|
+
('data', models.TextField(help_text='配置数据', null=True)),
|
|
22
|
+
('close', models.BooleanField(default=False, help_text='禁用')),
|
|
23
|
+
],
|
|
24
|
+
),
|
|
25
|
+
]
|
|
File without changes
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
from django.db import models
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
# auto配置文件
|
|
5
|
+
class AdminAConfModel(models.Model):
|
|
6
|
+
created_at = models.DateTimeField(auto_now_add=True, )
|
|
7
|
+
updated_at = models.DateTimeField(auto_now=True, )
|
|
8
|
+
code = models.CharField(help_text="项目代码", max_length=100, )
|
|
9
|
+
data = models.TextField(null=True, help_text="配置数据", )
|
|
10
|
+
close = models.BooleanField(default=False, help_text="禁用", )
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
from rest_framework.routers import DefaultRouter
|
|
2
|
+
from adminA import views
|
|
3
|
+
from django.conf import settings
|
|
4
|
+
|
|
5
|
+
ROUTER = settings.ADMIN_A.get('ROUTER', {})
|
|
6
|
+
|
|
7
|
+
router_admin = DefaultRouter()
|
|
8
|
+
|
|
9
|
+
# 配置文件
|
|
10
|
+
# router_admin.register(r'^.*assistant/$', views.AdminAConfViewSet, basename='conf')
|
|
11
|
+
router_admin.register(r'conf', views.AdminAConfViewSet, basename='conf')
|
|
12
|
+
|
|
13
|
+
# 主页
|
|
14
|
+
router_index = ROUTER.get('index', {})
|
|
15
|
+
prefix = router_index.get('prefix', 'adminA')
|
|
16
|
+
basename = router_index.get('basename', prefix)
|
|
17
|
+
router_admin.register(prefix, views.IndexViewSet, basename=basename)
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import os
|
|
2
|
+
from pathlib import Path
|
|
3
|
+
|
|
4
|
+
from django.http import HttpResponse
|
|
5
|
+
from rest_framework.viewsets import ModelViewSet
|
|
6
|
+
from adminA import serializers
|
|
7
|
+
from adminA import models
|
|
8
|
+
from rest_framework.viewsets import mixins, GenericViewSet
|
|
9
|
+
from rest_framework.response import Response
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
# 得到静态网页的二进制数据
|
|
13
|
+
def get_html_data():
|
|
14
|
+
parent = Path(__file__).resolve().parent
|
|
15
|
+
index_path = parent / 'static' / 'adminA' / 'index.html'
|
|
16
|
+
|
|
17
|
+
if not os.path.exists(index_path):
|
|
18
|
+
return None
|
|
19
|
+
with open(index_path, 'rb') as file_obj:
|
|
20
|
+
data = file_obj.read()
|
|
21
|
+
try:
|
|
22
|
+
data = data.decode('utf8')
|
|
23
|
+
except UnicodeDecodeError:
|
|
24
|
+
data = data.decode('gbk')
|
|
25
|
+
return data
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
# 主页
|
|
29
|
+
class IndexViewSet(ModelViewSet):
|
|
30
|
+
|
|
31
|
+
def list(self, request, *args, **kwargs):
|
|
32
|
+
html_data = get_html_data()
|
|
33
|
+
if not html_data:
|
|
34
|
+
data = '404'
|
|
35
|
+
return HttpResponse(content=data, status=404)
|
|
36
|
+
return HttpResponse(content=html_data, status=200)
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
# adminA配置
|
|
40
|
+
class AdminAConfViewSet(GenericViewSet,
|
|
41
|
+
mixins.ListModelMixin,
|
|
42
|
+
mixins.RetrieveModelMixin,
|
|
43
|
+
mixins.CreateModelMixin,
|
|
44
|
+
):
|
|
45
|
+
serializer_class = serializers.AdminAConfSerializer
|
|
46
|
+
queryset = models.AdminAConfModel.objects.all().order_by('id')
|
|
47
|
+
|
|
48
|
+
def list(self, request, *args, **kwargs):
|
|
49
|
+
conf_obj = models.AdminAConfModel.objects.filter().order_by('updated_at').last()
|
|
50
|
+
if not conf_obj:
|
|
51
|
+
return HttpResponse(content='配置文件没找到', status=404)
|
|
52
|
+
serializer_obj = serializers.AdminAConfSerializer(conf_obj, context=self.get_serializer_context())
|
|
53
|
+
data = serializer_obj.data
|
|
54
|
+
|
|
55
|
+
return Response(data, status=200)
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: adminA
|
|
3
|
+
Version: 2024.6.29.11
|
|
4
|
+
Summary: 为django应用提供快速的管理员页面构建.使用drf及0代码操作提供更快捷的admin页面构建.
|
|
5
|
+
Author-email: YanChengxin <yan.cheng.xin@foxmail.com>
|
|
6
|
+
Project-URL: Homepage, https://github.com/pypa/sampleproject
|
|
7
|
+
Project-URL: Issues, https://github.com/pypa/sampleproject/issues
|
|
8
|
+
Classifier: Programming Language :: Python :: 3
|
|
9
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
10
|
+
Classifier: Operating System :: OS Independent
|
|
11
|
+
Requires-Python: >=3.8
|
|
12
|
+
Description-Content-Type: text/markdown
|
|
13
|
+
License-File: LICENSE
|
|
14
|
+
|
|
15
|
+
功能:为django应用提供快速的管理员页面构建
|
|
16
|
+
用法:安装pip install adminA
|
|
17
|
+
待补充
|
|
18
|
+
项目开发中,目前还不能用
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
LICENSE
|
|
2
|
+
README.md
|
|
3
|
+
pyproject.toml
|
|
4
|
+
src/adminA/__init__.py
|
|
5
|
+
src/adminA/example.py
|
|
6
|
+
src/adminA/models.py
|
|
7
|
+
src/adminA/serializers.py
|
|
8
|
+
src/adminA/urls.py
|
|
9
|
+
src/adminA/views.py
|
|
10
|
+
src/adminA.egg-info/PKG-INFO
|
|
11
|
+
src/adminA.egg-info/SOURCES.txt
|
|
12
|
+
src/adminA.egg-info/dependency_links.txt
|
|
13
|
+
src/adminA.egg-info/top_level.txt
|
|
14
|
+
src/adminA/migrations/0001_initial.py
|
|
15
|
+
src/adminA/migrations/__init__.py
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
adminA
|