Skip to content

Commit 56b40e3

Browse files
author
stephanie
committed
update the siteid filter
1 parent e68260e commit 56b40e3

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

Examples/Sample.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
# session_factory= dbconnection.createConnection('mssql', "(local)", "ODM2", "ODM", "odm")#win MSSQL
2323

2424
# session_factory= dbconnection.createConnection('mssql', "arroyoodm2", "", "ODM", "odm")#mac/linux MSSQL
25-
session_factory = dbconnection.createConnection('sqlite', '/Users/stephanie/DEV/YODA-Tools/tests/test_files/ODM2_ts_specimen.sqlite', 2.0)
25+
session_factory = dbconnection.createConnection('sqlite', '/Users/stephanie/DEV/YODA-Tools/tests/test_files/XL_specimen.sqlite', 2.0)
2626

2727

2828

@@ -36,7 +36,10 @@
3636
#_session = session_factory.getSession()
3737
read = ReadODM2(session_factory)
3838
create = CreateODM2(session_factory)
39-
results = read.getResults(siteid=1, variableid=2, type = "Measurement")
39+
40+
41+
results = read.getResults(siteid=1, variableid=2, type="measurement")
42+
#sfids [26, 30, 32, 37, 63, 66, 84, 92, 99, 106, 110, 148, 160, 167, 210, 236, 244, 245, 250, 264, 266, 267, 330, 343, 353, 363, 364, 372, 405, 409, 419, 420, 421, 423, 424, 436, 469, 502, 513, 543, 547, 562, 574, 586, 587, 592, 594, 596, 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, 621, 622, 623, 624, 625, 626, 627, 628, 629, 996, 1005, 1007, 1013, 1014]
4043
resultValues = read.getResultValues(resultids=[2, 3, 4, 5, 6])
4144
relatedEmpty = read.getRelatedSamplingFeatures(sfid=1)
4245
related = read.getRelatedSamplingFeatures(sfid=2)

odm2api/ODM2/services/readService.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -565,7 +565,7 @@ def getResults(self, ids=None, type=None, uuids=None, actionid=None, simulationi
565565
.filter(RelatedFeatures.RelatedFeatureID == siteid)
566566
#.filter(RelatedFeatures.RelationshipTypeCV == "Was Collected at")
567567
.all()]
568-
query = query.join(FeatureActions).filter(SamplingFeatures.SamplingFeatureID.in_(sfids))
568+
query = query.join(FeatureActions).filter(FeatureActions.SamplingFeatureID.in_(sfids))
569569

570570
try:
571571
return query.all()

0 commit comments

Comments
 (0)