django-fast-treenode 3.0.7__py3-none-any.whl → 3.0.8__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.
treenode/views/common.py CHANGED
@@ -1,23 +1,23 @@
1
- # -*- coding: utf-8 -*-
2
- """
3
- Created on Thu Apr 10 19:50:23 2025
4
-
5
- Version: 3.0.0
6
- Author: Timur Kady
7
- Email: timurkady@yandex.com
8
- """
9
-
10
- from django.apps import apps
11
- from django.http import Http404
12
-
13
-
14
- def get_model_from_request(request):
15
- """Get model from request."""
16
- model_label = request.GET.get("model")
17
- if not model_label:
18
- raise Http404("Missing 'model' parameter.")
19
- try:
20
- app_label, model_name = model_label.lower().split(".")
21
- return apps.get_model(app_label, model_name)
22
- except Exception:
23
- raise Http404(f"Invalid model format: {model_label}")
1
+ # -*- coding: utf-8 -*-
2
+ """
3
+ Created on Thu Apr 10 19:50:23 2025
4
+
5
+ Version: 3.0.0
6
+ Author: Timur Kady
7
+ Email: timurkady@yandex.com
8
+ """
9
+
10
+ from django.apps import apps
11
+ from django.http import Http404
12
+
13
+
14
+ def get_model_from_request(request):
15
+ """Get model from request."""
16
+ model_label = request.GET.get("model")
17
+ if not model_label:
18
+ raise Http404("Missing 'model' parameter.")
19
+ try:
20
+ app_label, model_name = model_label.lower().split(".")
21
+ return apps.get_model(app_label, model_name)
22
+ except Exception:
23
+ raise Http404(f"Invalid model format: {model_label}")