From 49309d254e7880dbef3270f0ebaf8b1290e6e275 Mon Sep 17 00:00:00 2001 From: Dominik Lindner Date: Thu, 19 Jan 2017 15:40:16 +0000 Subject: [PATCH 1/2] Show platename for well tags --- .../tools/OmeroWeb/omeroweb/webclient/tree.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/components/tools/OmeroWeb/omeroweb/webclient/tree.py b/components/tools/OmeroWeb/omeroweb/webclient/tree.py index 58de63e586a..269b285c7a8 100644 --- a/components/tools/OmeroWeb/omeroweb/webclient/tree.py +++ b/components/tools/OmeroWeb/omeroweb/webclient/tree.py @@ -1505,7 +1505,8 @@ def marshal_tagged(conn, tag_id, group_id=-1, experimenter_id=-1, page=1, obj.column as column, plate.id as plateId, plate.columnNamingConvention as colnames, - plate.rowNamingConvention as rownames) + plate.rowNamingConvention as rownames, + plate.name as platename) from Well obj join obj.annotationLinks alink join obj.plate plate @@ -1524,8 +1525,9 @@ def marshal_tagged(conn, tag_id, group_id=-1, experimenter_id=-1, page=1, e[0]["column"], e[0]["plateId"], e[0]["rownames"], - e[0]["colnames"]] - wells.append(_marshal_well(conn, e[0:8])) + e[0]["colnames"], + e[0]["platename"]] + wells.append(_marshal_well(conn, e[0:9])) tagged['wells'] = wells return tagged @@ -1544,7 +1546,8 @@ def _marshal_well(conn, row): @param row The Well row to marshal @type row L{list} ''' - well_id, owner_id, perms, row, col, plateId, rownames, colnames = row + well_id, owner_id, perms, row, col, plateId, rownames, colnames,\ + platename = row well = dict() well['id'] = unwrap(well_id) well['ownerId'] = unwrap(owner_id) @@ -1553,7 +1556,7 @@ def _marshal_well(conn, row): parse_permissions_css(perms, unwrap(owner_id), conn) rowname = str(row + 1) if rownames == 'number' else _letterGridLabel(row) colname = _letterGridLabel(col) if colnames == 'letter' else str(col + 1) - well['name'] = "%s%s" % (rowname, colname) + well['name'] = "%s - %s%s" % (platename, rowname, colname) return well From 754ead8d64c40b3e6b1fd3e3280d64b8dec9a4af Mon Sep 17 00:00:00 2001 From: Dominik Lindner Date: Fri, 20 Jan 2017 10:53:19 +0000 Subject: [PATCH 2/2] Adjusted integration test --- components/tools/OmeroWeb/test/integration/test_tree.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/components/tools/OmeroWeb/test/integration/test_tree.py b/components/tools/OmeroWeb/test/integration/test_tree.py index 62c4d08bc15..b6f4607f176 100644 --- a/components/tools/OmeroWeb/test/integration/test_tree.py +++ b/components/tools/OmeroWeb/test/integration/test_tree.py @@ -243,11 +243,12 @@ def expected_wells(user, wells): for well in wells: rName = unwrap(well.plate.rowNamingConvention) cName = unwrap(well.plate.columnNamingConvention) + pName = unwrap(well.plate.name) row = well.row.val col = well.column.val rowname = str(row + 1) if rName == 'number' else _letterGridLabel(row) colname = _letterGridLabel(col) if cName == 'letter' else str(col + 1) - name = "%s%s" % (rowname, colname) + name = "%s - %s%s" % (pName, rowname, colname) expected.append({ 'id': well.id.val, 'name': name,