epok-toolkit 1.12.0__py3-none-any.whl → 1.12.2__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.

@@ -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,10 +39,17 @@ class BaseOptimizedViewSet(viewsets.ModelViewSet):
38
39
  manager = model_cls._default_manager
39
40
 
40
41
  if hasattr(manager, 'simple') and self.action == 'list':
41
- return manager.simple()
42
+ log.debug("| LIBRERIA |Usando sin simple sin filtros")
43
+ qs = manager.simple()
42
44
  elif hasattr(manager, 'full'):
43
- return manager.full()
44
-
45
+ log.debug("Usando sin full sin filtros")
46
+ qs = manager.full()
47
+
48
+ if hasattr(manager, 'created_by'):
49
+ log.debug("| LIBRERIA |Filtrando por created_by")
50
+ return qs.filter(created_by=self.request.user)
51
+
52
+ return qs
45
53
 
46
54
  def get_serializer_class(self):
47
55
 
@@ -59,7 +67,11 @@ class BaseOptimizedViewSet(viewsets.ModelViewSet):
59
67
 
60
68
 
61
69
  def perform_create(self, serializer):
62
- serializer.save(created_by=self.request.user, updated_by=self.request.user)
63
-
70
+ if hasattr(serializer, 'created_by') and hasattr(serializer, 'updated_by'):
71
+ log.debug("| LIBRERIA |Guardando con created_by y updated_by")
72
+ serializer.save(created_by=self.request.user, updated_by=self.request.user)
73
+
64
74
  def perform_update(self, serializer):
65
- serializer.save(updated_by=self.request.user)
75
+ if hasattr(serializer, 'updated_by'):
76
+ log.debug("| LIBRERIA |Guardando con updated_by")
77
+ serializer.save(updated_by=self.request.user)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: epok-toolkit
3
- Version: 1.12.0
3
+ Version: 1.12.2
4
4
  Summary: Una herramienta para la gestión de tareas y procesos en Django con Celery.
5
5
  Author-email: Fernando Leon Franco <fernanlee2131@gmail.com>
6
6
  License: MIT
@@ -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=qzq0TMmzVee65PLYWTsL2NJq0iZjBVUTZuFRatxfl3Q,1932
10
+ epok_toolkit/django/viewsets.py,sha256=0oAeepiQAL1hAqp73k0W11q6pJlvsS2aVQk3GfZ9sY0,2530
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.0.dist-info/licenses/LICENSE,sha256=iLDbGXdLSIOT5OsxzHCvtmxHtonE21GiFlS3LNkug4A,128
29
- epok_toolkit-1.12.0.dist-info/METADATA,sha256=MPahT1yQzaukPNXmJmEAml3SGllxJMFQgrupyOoaK2M,2217
30
- epok_toolkit-1.12.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
31
- epok_toolkit-1.12.0.dist-info/top_level.txt,sha256=Wo72AqIFcfWwBGM5F5iGFw9PrO3WBnTSprFZIJk_pNg,13
32
- epok_toolkit-1.12.0.dist-info/RECORD,,
28
+ epok_toolkit-1.12.2.dist-info/licenses/LICENSE,sha256=iLDbGXdLSIOT5OsxzHCvtmxHtonE21GiFlS3LNkug4A,128
29
+ epok_toolkit-1.12.2.dist-info/METADATA,sha256=DAEDs7wN_MotkSw9---npJdk6EyCPVKfBQs9c7ZBiw8,2217
30
+ epok_toolkit-1.12.2.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
31
+ epok_toolkit-1.12.2.dist-info/top_level.txt,sha256=Wo72AqIFcfWwBGM5F5iGFw9PrO3WBnTSprFZIJk_pNg,13
32
+ epok_toolkit-1.12.2.dist-info/RECORD,,