Permalink
Browse files

removing annotation counter from loadDataByTag, see #8557 ref #5514

  • Loading branch information...
1 parent e453708 commit 57007d24b7d6e4cc37340a209e3d741560757b32 @aleksandra-tarkowska committed Apr 18, 2012
Showing with 7 additions and 47 deletions.
  1. +7 −47 components/tools/OmeroWeb/omeroweb/webclient/controller/container.py
@@ -261,54 +261,14 @@ def loadDataByTag(self):
sc_list = list(self.conn.getObjectsByAnnotations('Screen',[self.tag.id]))
pl_list = list(self.conn.getObjectsByAnnotations('Plate',[self.tag.id]))
- pr_list_with_counters = list()
- ds_list_with_counters = list()
- im_list_with_counters = list()
- sc_list_with_counters = list()
- pl_list_with_counters = list()
-
- pr_ids = [pr.id for pr in pr_list]
- if len(pr_ids) > 0:
- pr_annotation_counter = self.conn.getCollectionCount("Project", "annotationLinks", pr_ids)
-
- for pr in pr_list:
- pr.annotation_counter = pr_annotation_counter.get(pr.id)
- pr_list_with_counters.append(pr)
-
- ds_ids = [ds.id for ds in ds_list]
- if len(ds_ids) > 0:
- ds_annotation_counter = self.conn.getCollectionCount("Dataset", "annotationLinks", ds_ids)
-
- for ds in ds_list:
- ds.annotation_counter = ds_annotation_counter.get(ds.id)
- ds_list_with_counters.append(ds)
-
- im_ids = [im.id for im in im_list]
- if len(im_ids) > 0:
- im_annotation_counter = self.conn.getCollectionCount("Image", "annotationLinks", im_ids)
-
- for im in im_list:
- im.annotation_counter = im_annotation_counter.get(im.id)
- im_list_with_counters.append(im)
-
- sc_ids = [sc.id for sc in sc_list]
- if len(sc_ids) > 0:
- sc_annotation_counter = self.conn.getCollectionCount("Screen", "annotationLinks", sc_ids)
-
- for sc in sc_list:
- sc.annotation_counter = sc_annotation_counter.get(sc.id)
- sc_list_with_counters.append(sc)
-
- pl_ids = [pl.id for pl in pl_list]
- if len(pl_ids) > 0:
- pl_annotation_counter = self.conn.getCollectionCount("Plate", "annotationLinks", pl_ids)
-
- for pl in pl_list:
- pl.annotation_counter = pl_annotation_counter.get(pl.id)
- pl_list_with_counters.append(pl)
+ pr_list.sort(key=lambda x: x.getName() and x.getName().lower())
+ ds_list.sort(key=lambda x: x.getName() and x.getName().lower())
+ im_list.sort(key=lambda x: x.getName() and x.getName().lower())
+ sc_list.sort(key=lambda x: x.getName() and x.getName().lower())
+ pl_list.sort(key=lambda x: x.getName() and x.getName().lower())
- self.containers={'projects': pr_list_with_counters, 'datasets': ds_list_with_counters, 'images': im_list_with_counters, 'screens':sc_list_with_counters, 'plates':pl_list_with_counters}
- self.c_size = len(pr_list_with_counters)+len(ds_list_with_counters)+len(im_list_with_counters)+len(sc_list_with_counters)+len(pl_list_with_counters)
+ self.containers={'projects': pr_list, 'datasets': ds_list, 'images': im_list, 'screens':sc_list, 'plates':pl_list}
+ self.c_size = len(pr_list)+len(ds_list)+len(im_list)+len(sc_list)+len(pl_list)
def listImagesInDataset(self, did, eid=None, page=None):
if eid is not None:

0 comments on commit 57007d2

Please sign in to comment.