nlbone 0.6.15__py3-none-any.whl → 0.6.16__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.
@@ -13,20 +13,20 @@ class PaginateRequest:
13
13
  """
14
14
 
15
15
  def __init__(
16
- self,
17
- limit: int = 10,
18
- offset: int = 0,
19
- sort: Optional[str] = None,
20
- filters: Optional[str] = Query(None, description="e.g. title:abc"),
21
- include: Optional[str] = None,
16
+ self,
17
+ limit: int = 10,
18
+ offset: int = 0,
19
+ sort: Optional[str] = None,
20
+ filters: Optional[str] = Query(None, description="e.g. title:abc"),
21
+ include: Optional[str] = None,
22
22
  ) -> None:
23
23
  self.limit = max(0, limit)
24
24
  self.offset = max(0, offset)
25
25
  self.sort = self._parse_sort(sort)
26
26
  self.filters = self._parse_filters(filters or "")
27
27
  self.include_ids: List[int] = ([int(x) for x in include.split(",") if x.strip().isdigit()] if include else [])[
28
- :50
29
- ]
28
+ :50
29
+ ]
30
30
 
31
31
  @staticmethod
32
32
  def _parse_sort(sort_str: Optional[str]) -> list[dict[str, str]]:
@@ -78,6 +78,9 @@ class PaginateRequest:
78
78
  filters_dict[key] = value_cast
79
79
  return filters_dict
80
80
 
81
+ def remove_deleted(self, deleted_at_field: str = 'deleted_at'):
82
+ self.filters = self.filters | {'deleted_at': None}
83
+
81
84
 
82
85
  class PaginateResponse:
83
86
  """
@@ -85,12 +88,12 @@ class PaginateResponse:
85
88
  """
86
89
 
87
90
  def __init__(
88
- self,
89
- data: list[Any],
90
- total_count: int | None,
91
- limit: int,
92
- offset: int,
93
- use_data_key: bool = True,
91
+ self,
92
+ data: list[Any],
93
+ total_count: int | None,
94
+ limit: int,
95
+ offset: int,
96
+ use_data_key: bool = True,
94
97
  ) -> None:
95
98
  self.data = data
96
99
  self.total_count = total_count
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: nlbone
3
- Version: 0.6.15
3
+ Version: 0.6.16
4
4
  Summary: Backbone package for interfaces and infrastructure in Python projects
5
5
  Author-email: Amir Hosein Kahkbazzadeh <a.khakbazzadeh@gmail.com>
6
6
  License: MIT
@@ -76,7 +76,7 @@ nlbone/interfaces/api/middleware/access_log.py,sha256=vIkxxxfy2HcjqqKb8XCfGCcSri
76
76
  nlbone/interfaces/api/middleware/add_request_context.py,sha256=av-qs0biOYuF9R6RJOo2eYsFqDL9WRYWcjVakFhbt-w,1834
77
77
  nlbone/interfaces/api/middleware/authentication.py,sha256=ze7vCm492QsX9nPL6A-PqZCmC1C5ZgUE-OWI6fCLpsU,1809
78
78
  nlbone/interfaces/api/pagination/__init__.py,sha256=pA1uC4rK6eqDI5IkLVxmgO2B6lExnOm8Pje2-hifJZw,431
79
- nlbone/interfaces/api/pagination/offset_base.py,sha256=iipO09sAUb0U9ctMMujBHQo1IgMRbasvwnHJFtA9ZeA,3812
79
+ nlbone/interfaces/api/pagination/offset_base.py,sha256=w44uBX268WW6JWvyV5hBtvTuN3Da8lSfwLDMgSP1CAQ,4044
80
80
  nlbone/interfaces/api/schema/__init__.py,sha256=LAqgynfupeqOQ6u0I5ucrcYnojRMZUg9yW8IjKSQTNI,119
81
81
  nlbone/interfaces/api/schema/adaptive_schema.py,sha256=bdWBNpP2NfOJ_in4btXn0lrZOK70x-OqfmZ-NpIJdoQ,3347
82
82
  nlbone/interfaces/api/schema/base_response_model.py,sha256=Y-mqNzVheTaGkM4m2DsybK-GLhfODMhBUNyTRoaf_Zc,600
@@ -93,8 +93,8 @@ nlbone/utils/context.py,sha256=MmclJ24BG2uvSTg1IK7J-Da9BhVFDQ5ag4Ggs2FF1_w,1600
93
93
  nlbone/utils/http.py,sha256=UXUoXgQdTRNT08ho8zl-C5ekfDsD8uf-JiMQ323ooqw,872
94
94
  nlbone/utils/redactor.py,sha256=-V4HrHmHwPi3Kez587Ek1uJlgK35qGSrwBOvcbw8Jas,1279
95
95
  nlbone/utils/time.py,sha256=DjjyQ9GLsfXoT6NK8RDW2rOlJg3e6sF04Jw6PBUrSvg,1268
96
- nlbone-0.6.15.dist-info/METADATA,sha256=t9hCCQwgtmGzXZOwsvXsc5hinAX5ogPmN36zOQPdyfk,2228
97
- nlbone-0.6.15.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
98
- nlbone-0.6.15.dist-info/entry_points.txt,sha256=CpIL45t5nbhl1dGQPhfIIDfqqak3teK0SxPGBBr7YCk,59
99
- nlbone-0.6.15.dist-info/licenses/LICENSE,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
100
- nlbone-0.6.15.dist-info/RECORD,,
96
+ nlbone-0.6.16.dist-info/METADATA,sha256=z5PdS95EZDyFi5vrYuOlPi15vE-BkjX37l0SD4od30M,2228
97
+ nlbone-0.6.16.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
98
+ nlbone-0.6.16.dist-info/entry_points.txt,sha256=CpIL45t5nbhl1dGQPhfIIDfqqak3teK0SxPGBBr7YCk,59
99
+ nlbone-0.6.16.dist-info/licenses/LICENSE,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
100
+ nlbone-0.6.16.dist-info/RECORD,,