epok-toolkit 1.12.1__py3-none-any.whl → 1.12.3__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 epok-toolkit might be problematic. Click here for more details.
- epok_toolkit/django/viewsets.py +22 -5
- {epok_toolkit-1.12.1.dist-info → epok_toolkit-1.12.3.dist-info}/METADATA +1 -1
- {epok_toolkit-1.12.1.dist-info → epok_toolkit-1.12.3.dist-info}/RECORD +6 -6
- {epok_toolkit-1.12.1.dist-info → epok_toolkit-1.12.3.dist-info}/WHEEL +0 -0
- {epok_toolkit-1.12.1.dist-info → epok_toolkit-1.12.3.dist-info}/licenses/LICENSE +0 -0
- {epok_toolkit-1.12.1.dist-info → epok_toolkit-1.12.3.dist-info}/top_level.txt +0 -0
epok_toolkit/django/viewsets.py
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
from rest_framework import viewsets
|
|
3
3
|
from rest_framework.pagination import PageNumberPagination
|
|
4
4
|
from rest_framework.permissions import IsAuthenticated
|
|
5
|
+
from colorstreak import log
|
|
5
6
|
|
|
6
7
|
class DefaultPagination(PageNumberPagination):
|
|
7
8
|
"""
|
|
@@ -38,14 +39,20 @@ class BaseOptimizedViewSet(viewsets.ModelViewSet):
|
|
|
38
39
|
manager = model_cls._default_manager
|
|
39
40
|
|
|
40
41
|
if hasattr(manager, 'simple') and self.action == 'list':
|
|
42
|
+
log.debug("| LIBRERIA | Usando QS simple")
|
|
41
43
|
qs = manager.simple()
|
|
42
44
|
elif hasattr(manager, 'full'):
|
|
45
|
+
log.debug("| LIBRERIA | Usando QS full")
|
|
43
46
|
qs = manager.full()
|
|
44
47
|
|
|
45
|
-
|
|
48
|
+
try:
|
|
49
|
+
log.debug("| LIBRERIA | Filtrando por created_by")
|
|
46
50
|
return qs.filter(created_by=self.request.user)
|
|
47
|
-
|
|
48
|
-
|
|
51
|
+
except Exception as e:
|
|
52
|
+
log.error(f"| LIBRERIA | Error al filtrar por created_by: {e}")
|
|
53
|
+
log.info("| LIBRERIA | Filtrado sin created_by")
|
|
54
|
+
return qs
|
|
55
|
+
|
|
49
56
|
|
|
50
57
|
def get_serializer_class(self):
|
|
51
58
|
|
|
@@ -63,9 +70,19 @@ class BaseOptimizedViewSet(viewsets.ModelViewSet):
|
|
|
63
70
|
|
|
64
71
|
|
|
65
72
|
def perform_create(self, serializer):
|
|
66
|
-
|
|
73
|
+
try:
|
|
74
|
+
log.debug("| LIBRERIA |Guardando con created_by y updated_by")
|
|
67
75
|
serializer.save(created_by=self.request.user, updated_by=self.request.user)
|
|
76
|
+
except Exception as e:
|
|
77
|
+
log.error(f"| LIBRERIA | Error al guardar: {e}")
|
|
78
|
+
log.info("| LIBRERIA | Guardando sin created_by y updated_by")
|
|
79
|
+
serializer.save()
|
|
68
80
|
|
|
69
81
|
def perform_update(self, serializer):
|
|
70
|
-
|
|
82
|
+
try:
|
|
83
|
+
log.debug("| LIBRERIA | Guardando con updated_by")
|
|
71
84
|
serializer.save(updated_by=self.request.user)
|
|
85
|
+
except Exception as e:
|
|
86
|
+
log.error(f"| LIBRERIA | Error al actualizar: {e}")
|
|
87
|
+
log.info("| LIBRERIA | Guardando sin updated_by")
|
|
88
|
+
serializer.save()
|
|
@@ -7,7 +7,7 @@ epok_toolkit/django/fields.py,sha256=-ajP5qx-4bt9Qz9yW48gTlinTxD1xWPKOEkslqx8cSM
|
|
|
7
7
|
epok_toolkit/django/manager.py,sha256=3MZcA9wQY4E1KD8XlgZQbzf4wlF9vA8Pntl_gKDWfpA,1350
|
|
8
8
|
epok_toolkit/django/models.py,sha256=E1zj2KetRGszksQvLk3HN5kWkYkEYzJRRmAUOaLJmw8,1090
|
|
9
9
|
epok_toolkit/django/response.py,sha256=O8OHBaKgUQjBeYLLbgTTs669l_4D6swUgAOwswjc-88,1716
|
|
10
|
-
epok_toolkit/django/viewsets.py,sha256=
|
|
10
|
+
epok_toolkit/django/viewsets.py,sha256=xE1yxpjpWr8_gnBFYPg3mTX58U3H9_BYCi6YIiji6Hw,2934
|
|
11
11
|
epok_toolkit/django/utils/__init__.py,sha256=zDuoqm_eksZQpL-Bvd_q2KGMtSXfprBjf4TScZiwV6k,25
|
|
12
12
|
epok_toolkit/django/utils/magic_link.py,sha256=GiDuy0kAGdYohGPlBL7rwpKPMpXuB1wJa1k5LTAOm4w,889
|
|
13
13
|
epok_toolkit/email/__init__.py,sha256=pyJwysyVoq6DuYAG72fulsKFoOuAfjw3aBH7FhmYGHc,35
|
|
@@ -25,8 +25,8 @@ epok_toolkit/pdf/fuentes/Kollektif-Italic.ttf,sha256=1CXPyw43il9u0tQ_7aRzsEaVtg3
|
|
|
25
25
|
epok_toolkit/pdf/fuentes/Kollektif.ttf,sha256=7wTLkVVNUm1giLjIZcWRUH5r2r3o0GjdKic4V1A-pNQ,51128
|
|
26
26
|
epok_toolkit/pdf/plantillas/Ticket_congrats.png,sha256=OSQhVR0j_nLHE6kSJ33BTR-77HM1fNAfJBe2EuX6wVk,157141
|
|
27
27
|
epok_toolkit/pdf/plantillas/Ticket_congrats2.png,sha256=1RBogBdo-8WSMpD3H73HoLgJtr5EC5oVKfOCIWOxPSo,373605
|
|
28
|
-
epok_toolkit-1.12.
|
|
29
|
-
epok_toolkit-1.12.
|
|
30
|
-
epok_toolkit-1.12.
|
|
31
|
-
epok_toolkit-1.12.
|
|
32
|
-
epok_toolkit-1.12.
|
|
28
|
+
epok_toolkit-1.12.3.dist-info/licenses/LICENSE,sha256=iLDbGXdLSIOT5OsxzHCvtmxHtonE21GiFlS3LNkug4A,128
|
|
29
|
+
epok_toolkit-1.12.3.dist-info/METADATA,sha256=zPnN9xWgY8kAlhmeBkx4pIkXNFJRSBoxaUqPoCBUMEo,2217
|
|
30
|
+
epok_toolkit-1.12.3.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
31
|
+
epok_toolkit-1.12.3.dist-info/top_level.txt,sha256=Wo72AqIFcfWwBGM5F5iGFw9PrO3WBnTSprFZIJk_pNg,13
|
|
32
|
+
epok_toolkit-1.12.3.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|