Skip to content

Commit c6afa45

Browse files
committed
Removed limit, offset and order arguments from Model.get and Model.get_many
1 parent 1a7ca9e commit c6afa45

File tree

1 file changed

+3
-25
lines changed

1 file changed

+3
-25
lines changed

pyodoo/v12/model.py

Lines changed: 3 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -139,46 +139,31 @@ def get_model_data_reference(self,
139139
def get(self,
140140
entity_id: int,
141141
fields: tuple[str, ...] = None,
142-
options: dict[str, Any] = None,
143-
limit: Optional[int] = None,
144-
offset: Optional[int] = None,
145-
order: Optional[str] = None) -> Optional[dict[str, Any]]:
142+
options: dict[str, Any] = None) -> Optional[dict[str, Any]]:
146143
"""
147144
Get a row from a model using its ID
148145
149146
:param entity_id: Object ID to query
150147
:param fields: Tuple with the fields to include in the response
151148
:param options: Dictionary with options to use
152-
:param limit: Maximum number of results count
153-
:param offset: Starting record number to fetch the data
154-
:param order: Ordering clause
155149
:return: Dictionary with the requested fields
156150
"""
157151
results = self.get_many(entity_ids=[entity_id],
158152
fields=fields,
159-
options=options,
160-
limit=limit,
161-
offset=offset,
162-
order=order)
153+
options=options)
163154
return results[0] if results else None
164155

165156
def get_many(self,
166157
entity_ids: list[int],
167158
fields: tuple[str, ...] = None,
168-
options: dict[str, Any] = None,
169-
limit: Optional[int] = None,
170-
offset: Optional[int] = None,
171-
order: Optional[str] = None
159+
options: dict[str, Any] = None
172160
) -> Optional[list[dict[str, Any]]]:
173161
"""
174162
Get a row from a model using its ID
175163
176164
:param entity_ids: Object IDs to query
177165
:param fields: Tuple with the fields to include in the response
178166
:param options: Dictionary with options to use
179-
:param limit: Maximum number of results count
180-
:param offset: Starting record number to fetch the data
181-
:param order: Ordering clause
182167
:return: List of dictionaries with the requested fields
183168
"""
184169
# Set options
@@ -189,13 +174,6 @@ def get_many(self,
189174
options['fields'] = fields
190175
# Set language for translated fields
191176
self._set_options_language(options=options)
192-
# Set pagination
193-
self._set_pagination(options=options,
194-
limit=limit,
195-
offset=offset)
196-
# Set order
197-
self._set_order_by(options=options,
198-
order=order)
199177
# Request data and get results
200178
results = self.api.do_read_many(entity_ids=entity_ids,
201179
options=options)

0 commit comments

Comments
 (0)