Skip to content

Commit 5bf911c

Browse files
authored
Merge pull request #129 from lsetiawan/proc_lvl
Fix Processing Levels code and docstring
2 parents dd1ec35 + 89a7b95 commit 5bf911c

File tree

1 file changed

+18
-5
lines changed

1 file changed

+18
-5
lines changed

odm2api/ODM2/services/readService.py

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -390,15 +390,28 @@ def getMethods(self, ids=None, codes=None, type=None):
390390
# ProcessingLevel
391391
def getProcessingLevels(self, ids=None, codes=None):
392392
"""
393-
getProcessingLevels(self, ids=None, codes=None)
394-
* Pass nothing - returns full list of ProcessingLevel objects
395-
* Pass a list of ProcessingLevelID - returns a single processingLevel object for each given id
396-
* Pass a list of ProcessingLevelCode - returns a single processingLevel object for each given code
393+
Retrieve a list of Processing Levels
394+
395+
If no arguments are passed to the function, or their values are None,
396+
all Processing Levels objects in the database will be returned.
397+
398+
Args:
399+
ids (list, optional): List of Processing Levels IDs.
400+
codes (list, optional): List of Processing Levels Codes.
401+
402+
403+
Returns:
404+
list: List of ProcessingLevels Objects
405+
406+
Examples:
407+
>>> READ = ReadODM2(SESSION_FACTORY)
408+
>>> READ.getProcessingLevels(ids=[1, 3])
409+
>>> READ.getProcessingLevels(codes=['L1', 'L3'])
397410
398411
"""
399412
q = self._session.query(ProcessingLevels)
400413
if ids:
401-
q = q.filter(ProcessingLevels.ProcessingLevelsID.in_(ids))
414+
q = q.filter(ProcessingLevels.ProcessingLevelID.in_(ids))
402415
if codes:
403416
q = q.filter(ProcessingLevels.ProcessingLevelCode.in_(codes))
404417

0 commit comments

Comments
 (0)