maleo-foundation 0.2.53__py3-none-any.whl → 0.2.55__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.
@@ -124,22 +124,22 @@ class BaseQueryUtils:
124
124
  if parent_attr is None or not isinstance(parent_attr, InstrumentedAttribute):
125
125
  return query
126
126
  if is_parent is not None:
127
- subq = session.query(table).filter(parent_attr == id_attr).exists()
127
+ subq = session.query(table).filter(parent_attr == id_attr).correlate(table).exists()
128
128
  query = query.filter(subq if is_parent else ~subq)
129
129
  return query
130
130
 
131
131
  @staticmethod
132
- def filter_is_children(
132
+ def filter_is_child(
133
133
  query:Query,
134
134
  table:Type[DeclarativeMeta],
135
135
  parent_column:str = "parent_id",
136
- is_children:BaseTypes.OptionalBoolean = None
136
+ is_child:BaseTypes.OptionalBoolean = None
137
137
  ) -> Query:
138
138
  parent_attr = getattr(table, parent_column, None)
139
139
  if parent_attr is None or not isinstance(parent_attr, InstrumentedAttribute):
140
140
  return query
141
- if is_children is not None:
142
- query = query.filter(parent_attr.is_not(None) if is_children else parent_attr.is_(None))
141
+ if is_child is not None:
142
+ query = query.filter(parent_attr.is_not(None) if is_child else parent_attr.is_(None))
143
143
  return query
144
144
 
145
145
  @staticmethod
@@ -158,7 +158,7 @@ class BaseQueryUtils:
158
158
  if parent_attr is None or not isinstance(parent_attr, InstrumentedAttribute):
159
159
  return query
160
160
  if is_leaf is not None:
161
- subq = session.query(table).filter(parent_attr == id_attr).exists()
161
+ subq = session.query(table).filter(parent_attr == id_attr).correlate(table).exists()
162
162
  query = query.filter(~subq if is_leaf else subq)
163
163
  return query
164
164
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: maleo_foundation
3
- Version: 0.2.53
3
+ Version: 0.2.55
4
4
  Summary: Foundation package for Maleo
5
5
  Author-email: Agra Bima Yuda <agra@nexmedis.com>
6
6
  License: MIT
@@ -104,7 +104,7 @@ maleo_foundation/utils/exceptions.py,sha256=kDLTWiUauvc-fSKrEyxlGvIi2NtZIAhJ9bV3
104
104
  maleo_foundation/utils/extractor.py,sha256=SZXVYDHWGaA-Dd1BUydwF2HHdZqexEielS4CjL0Ceng,814
105
105
  maleo_foundation/utils/logging.py,sha256=W5Fhk_xAXVqSujaY8mv3hRH4wlQSpUn4ReuMoiKcQa4,7759
106
106
  maleo_foundation/utils/mergers.py,sha256=DniUu3Ot4qkYH_YSw4uD1cn9cfirum4S_Opp8fMkQwA,702
107
- maleo_foundation/utils/query.py,sha256=fLPUZQx8JuFpt8joLq-bfbuKnTKrLQAaQlRLS7WSpKY,7718
107
+ maleo_foundation/utils/query.py,sha256=I-kPDbzVdHptBIdsefIb7ec4QkBnWWNKuTFBMkg9DYI,7740
108
108
  maleo_foundation/utils/repository.py,sha256=knBi3xOLlhBIEtChvqbZh4wXmgrFCB3rDwQXy41d7_c,2852
109
109
  maleo_foundation/utils/dependencies/__init__.py,sha256=0KKGrdfj8Cc5A4SRk_ZBAxzOP795Mizdb4zIBh07KC4,122
110
110
  maleo_foundation/utils/dependencies/auth.py,sha256=wS9qnmd1n2WsFhiSfyq_3Io3wwZKTENVPv4rMwxJslE,727
@@ -117,7 +117,7 @@ maleo_foundation/utils/loaders/credential/__init__.py,sha256=qopTKvcMVoTFwyRijeg
117
117
  maleo_foundation/utils/loaders/credential/google.py,sha256=SKsqPuFnAiCcYLf24CxKnMybhVHpgqnq1gGSlThqjts,994
118
118
  maleo_foundation/utils/loaders/key/__init__.py,sha256=hVygcC2ImHc_aVrSrOmyedR8tMUZokWUKCKOSh5ctbo,106
119
119
  maleo_foundation/utils/loaders/key/rsa.py,sha256=gDhyX6iTFtHiluuhFCozaZ3pOLKU2Y9TlrNMK_GVyGU,3796
120
- maleo_foundation-0.2.53.dist-info/METADATA,sha256=OYegfYykmsNoTZYJrsYAwYcpmL2KWNN4arn9Ms1se20,3598
121
- maleo_foundation-0.2.53.dist-info/WHEEL,sha256=zaaOINJESkSfm_4HQVc5ssNzHCPXhJm0kEUakpsEHaU,91
122
- maleo_foundation-0.2.53.dist-info/top_level.txt,sha256=_iBos3F_bhEOdjOnzeiEYSrCucasc810xXtLBXI8cQc,17
123
- maleo_foundation-0.2.53.dist-info/RECORD,,
120
+ maleo_foundation-0.2.55.dist-info/METADATA,sha256=i8k-mH5YkUoM1CVcZFQZbCaRMnsfCCqNsdPFw_nBZ5I,3598
121
+ maleo_foundation-0.2.55.dist-info/WHEEL,sha256=zaaOINJESkSfm_4HQVc5ssNzHCPXhJm0kEUakpsEHaU,91
122
+ maleo_foundation-0.2.55.dist-info/top_level.txt,sha256=_iBos3F_bhEOdjOnzeiEYSrCucasc810xXtLBXI8cQc,17
123
+ maleo_foundation-0.2.55.dist-info/RECORD,,