arthexis 0.1.11__py3-none-any.whl → 0.1.13__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.
Potentially problematic release.
This version of arthexis might be problematic. Click here for more details.
- {arthexis-0.1.11.dist-info → arthexis-0.1.13.dist-info}/METADATA +2 -2
- {arthexis-0.1.11.dist-info → arthexis-0.1.13.dist-info}/RECORD +50 -44
- config/asgi.py +15 -1
- config/celery.py +8 -1
- config/settings.py +49 -78
- config/settings_helpers.py +109 -0
- core/admin.py +293 -78
- core/apps.py +21 -0
- core/auto_upgrade.py +2 -2
- core/form_fields.py +75 -0
- core/models.py +203 -47
- core/reference_utils.py +1 -1
- core/release.py +42 -20
- core/system.py +6 -3
- core/tasks.py +92 -40
- core/tests.py +75 -1
- core/views.py +178 -29
- core/widgets.py +43 -0
- nodes/admin.py +583 -10
- nodes/apps.py +15 -0
- nodes/feature_checks.py +133 -0
- nodes/models.py +287 -49
- nodes/reports.py +411 -0
- nodes/tests.py +990 -42
- nodes/urls.py +1 -0
- nodes/utils.py +32 -0
- nodes/views.py +173 -5
- ocpp/admin.py +424 -17
- ocpp/consumers.py +630 -15
- ocpp/evcs.py +7 -94
- ocpp/evcs_discovery.py +158 -0
- ocpp/models.py +236 -4
- ocpp/routing.py +4 -2
- ocpp/simulator.py +346 -26
- ocpp/status_display.py +26 -0
- ocpp/store.py +110 -2
- ocpp/tests.py +1425 -33
- ocpp/transactions_io.py +27 -3
- ocpp/views.py +344 -38
- pages/admin.py +138 -3
- pages/context_processors.py +15 -1
- pages/defaults.py +1 -2
- pages/forms.py +67 -0
- pages/models.py +136 -1
- pages/tests.py +379 -4
- pages/urls.py +1 -0
- pages/views.py +64 -7
- {arthexis-0.1.11.dist-info → arthexis-0.1.13.dist-info}/WHEEL +0 -0
- {arthexis-0.1.11.dist-info → arthexis-0.1.13.dist-info}/licenses/LICENSE +0 -0
- {arthexis-0.1.11.dist-info → arthexis-0.1.13.dist-info}/top_level.txt +0 -0
core/widgets.py
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
from django import forms
|
|
2
|
+
from django.forms.widgets import ClearableFileInput
|
|
2
3
|
import json
|
|
3
4
|
|
|
4
5
|
|
|
@@ -49,3 +50,45 @@ class OdooProductWidget(forms.Select):
|
|
|
49
50
|
return json.loads(raw)
|
|
50
51
|
except Exception:
|
|
51
52
|
return {}
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
class AdminBase64FileWidget(ClearableFileInput):
|
|
56
|
+
"""Clearable file input that exposes base64 data for downloads."""
|
|
57
|
+
|
|
58
|
+
template_name = "widgets/admin_base64_file.html"
|
|
59
|
+
|
|
60
|
+
def __init__(
|
|
61
|
+
self,
|
|
62
|
+
*,
|
|
63
|
+
download_name: str | None = None,
|
|
64
|
+
content_type: str = "application/octet-stream",
|
|
65
|
+
**kwargs,
|
|
66
|
+
) -> None:
|
|
67
|
+
self.download_name = download_name
|
|
68
|
+
self.content_type = content_type
|
|
69
|
+
super().__init__(**kwargs)
|
|
70
|
+
|
|
71
|
+
def is_initial(self, value):
|
|
72
|
+
if isinstance(value, str):
|
|
73
|
+
return bool(value)
|
|
74
|
+
return super().is_initial(value)
|
|
75
|
+
|
|
76
|
+
def format_value(self, value):
|
|
77
|
+
if isinstance(value, str):
|
|
78
|
+
return value
|
|
79
|
+
return super().format_value(value)
|
|
80
|
+
|
|
81
|
+
def get_context(self, name, value, attrs):
|
|
82
|
+
if isinstance(value, str):
|
|
83
|
+
base64_value = value.strip()
|
|
84
|
+
rendered_value = None
|
|
85
|
+
else:
|
|
86
|
+
base64_value = None
|
|
87
|
+
rendered_value = value
|
|
88
|
+
context = super().get_context(name, rendered_value, attrs)
|
|
89
|
+
widget_context = context["widget"]
|
|
90
|
+
widget_context["is_initial"] = bool(base64_value)
|
|
91
|
+
widget_context["base64_value"] = base64_value
|
|
92
|
+
widget_context["download_name"] = self.download_name or f"{name}.bin"
|
|
93
|
+
widget_context["content_type"] = self.content_type
|
|
94
|
+
return context
|