{"action":"created","comment":{"url":"https://api.github.com/repos/openmicroscopy/openmicroscopy/pulls/comments/95830727","pull_request_review_id":16398279,"id":95830727,"diff_hunk":"@@ -3354,6 +3446,36 @@ def listOrphanedAnnotations(self, parent_type, parent_ids, eid=None,\n         for e in q.findAllByQuery(sql, p, self.SERVICE_OPTS):\n             yield AnnotationWrapper._wrap(self, e)\n \n+    def countAnnotations(self, objects):\n+        \"\"\"\n+        Get the annotion counts for the given objects\n+        \"\"\"\n+\n+        obj_type = None\n+        obj_ids = []\n+        for obj in objects:\n+            objtype = obj.split('=')[0]","path":"components/tools/OmeroPy/src/omero/gateway/__init__.py","position":118,"original_position":118,"commit_id":"c99b0e5c0e7535326d947cc4f0e04666cf938234","original_commit_id":"c99b0e5c0e7535326d947cc4f0e04666cf938234","user":{"login":"aleksandra-tarkowska","id":1065155,"avatar_url":"https://avatars.githubusercontent.com/u/1065155?v=3","gravatar_id":"","url":"https://api.github.com/users/aleksandra-tarkowska","html_url":"https://github.com/aleksandra-tarkowska","followers_url":"https://api.github.com/users/aleksandra-tarkowska/followers","following_url":"https://api.github.com/users/aleksandra-tarkowska/following{/other_user}","gists_url":"https://api.github.com/users/aleksandra-tarkowska/gists{/gist_id}","starred_url":"https://api.github.com/users/aleksandra-tarkowska/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aleksandra-tarkowska/subscriptions","organizations_url":"https://api.github.com/users/aleksandra-tarkowska/orgs","repos_url":"https://api.github.com/users/aleksandra-tarkowska/repos","events_url":"https://api.github.com/users/aleksandra-tarkowska/events{/privacy}","received_events_url":"https://api.github.com/users/aleksandra-tarkowska/received_events","type":"User","site_admin":false},"body":"So you could use `objtype=o.OMERO_CLASS` directly","created_at":"2017-01-12T16:33:59Z","updated_at":"2017-01-12T16:33:59Z","html_url":"https://github.com/openmicroscopy/openmicroscopy/pull/5023#discussion_r95830727","pull_request_url":"https://api.github.com/repos/openmicroscopy/openmicroscopy/pulls/5023","_links":{"self":{"href":"https://api.github.com/repos/openmicroscopy/openmicroscopy/pulls/comments/95830727"},"html":{"href":"https://github.com/openmicroscopy/openmicroscopy/pull/5023#discussion_r95830727"},"pull_request":{"href":"https://api.github.com/repos/openmicroscopy/openmicroscopy/pulls/5023"}}},"pull_request":{"url":"https://api.github.com/repos/openmicroscopy/openmicroscopy/pulls/5023","id":101045297,"html_url":"https://github.com/openmicroscopy/openmicroscopy/pull/5023","diff_url":"https://github.com/openmicroscopy/openmicroscopy/pull/5023.diff","patch_url":"https://github.com/openmicroscopy/openmicroscopy/pull/5023.patch","issue_url":"https://api.github.com/repos/openmicroscopy/openmicroscopy/issues/5023","number":5023,"state":"open","locked":false,"title":"Annotation count web","user":{"login":"dominikl","id":6575139,"avatar_url":"https://avatars.githubusercontent.com/u/6575139?v=3","gravatar_id":"","url":"https://api.github.com/users/dominikl","html_url":"https://github.com/dominikl","followers_url":"https://api.github.com/users/dominikl/followers","following_url":"https://api.github.com/users/dominikl/following{/other_user}","gists_url":"https://api.github.com/users/dominikl/gists{/gist_id}","starred_url":"https://api.github.com/users/dominikl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dominikl/subscriptions","organizations_url":"https://api.github.com/users/dominikl/orgs","repos_url":"https://api.github.com/users/dominikl/repos","events_url":"https://api.github.com/users/dominikl/events{/privacy}","received_events_url":"https://api.github.com/users/dominikl/received_events","type":"User","site_admin":false},"body":"# What this PR does\r\n\r\nShow the number of annotations available in the right hand side panel.\r\n\r\n![screen shot 2017-01-11 at 11 03 18](https://cloud.githubusercontent.com/assets/6575139/21846146/9db12bd2-d7ed-11e6-994b-82461cda5977.png)\r\n\r\n# Testing this PR\r\n\r\nAnnotate different objects (Images, Datasets, etc.). Select these objects (also some non-annotated objects) and make sure the annotation count shown is correct. Test with single as well as multi (batch) selection.\r\n\r\n# Related reading\r\n\r\n[Trello - RFE: Indication of number of annotations on an image in brackets (5) on accordion tabs in right hand pane.](https://trello.com/c/bc6ZtV0x/144-rfe-indication-of-number-of-annotations-on-an-image-in-brackets-5-on-accordion-tabs-in-right-hand-pane)\r\n\r\n\r\n**Not ready for review yet**\r\n\r\nToDo:\r\n- What about this \"Table\" annotation?\r\n- Annotating an object does not refresh the annotation count yet.\r\n- Is there a better way to query for the annotation count (unfortunately `count(*)` does not work with `fetch` joins) ?\r\n\r\n/cc @will-moore \r\n","created_at":"2017-01-11T11:05:39Z","updated_at":"2017-01-12T16:33:59Z","closed_at":null,"merged_at":null,"merge_commit_sha":"23b8ccd07a2a23b45ce6c7d913d214ea6c0364a8","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/openmicroscopy/openmicroscopy/pulls/5023/commits","review_comments_url":"https://api.github.com/repos/openmicroscopy/openmicroscopy/pulls/5023/comments","review_comment_url":"https://api.github.com/repos/openmicroscopy/openmicroscopy/pulls/comments{/number}","comments_url":"https://api.github.com/repos/openmicroscopy/openmicroscopy/issues/5023/comments","statuses_url":"https://api.github.com/repos/openmicroscopy/openmicroscopy/statuses/c99b0e5c0e7535326d947cc4f0e04666cf938234","head":{"label":"dominikl:annotation_count_web","ref":"annotation_count_web","sha":"c99b0e5c0e7535326d947cc4f0e04666cf938234","user":{"login":"dominikl","id":6575139,"avatar_url":"https://avatars.githubusercontent.com/u/6575139?v=3","gravatar_id":"","url":"https://api.github.com/users/dominikl","html_url":"https://github.com/dominikl","followers_url":"https://api.github.com/users/dominikl/followers","following_url":"https://api.github.com/users/dominikl/following{/other_user}","gists_url":"https://api.github.com/users/dominikl/gists{/gist_id}","starred_url":"https://api.github.com/users/dominikl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dominikl/subscriptions","organizations_url":"https://api.github.com/users/dominikl/orgs","repos_url":"https://api.github.com/users/dominikl/repos","events_url":"https://api.github.com/users/dominikl/events{/privacy}","received_events_url":"https://api.github.com/users/dominikl/received_events","type":"User","site_admin":false},"repo":{"id":16698231,"name":"openmicroscopy","full_name":"dominikl/openmicroscopy","owner":{"login":"dominikl","id":6575139,"avatar_url":"https://avatars.githubusercontent.com/u/6575139?v=3","gravatar_id":"","url":"https://api.github.com/users/dominikl","html_url":"https://github.com/dominikl","followers_url":"https://api.github.com/users/dominikl/followers","following_url":"https://api.github.com/users/dominikl/following{/other_user}","gists_url":"https://api.github.com/users/dominikl/gists{/gist_id}","starred_url":"https://api.github.com/users/dominikl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dominikl/subscriptions","organizations_url":"https://api.github.com/users/dominikl/orgs","repos_url":"https://api.github.com/users/dominikl/repos","events_url":"https://api.github.com/users/dominikl/events{/privacy}","received_events_url":"https://api.github.com/users/dominikl/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/dominikl/openmicroscopy","description":"OME (Open Microscopy Environment) develops open-source software and data format standards for the storage and manipulation of biological light microscopy data. A joint project between universities, research establishments and industry in Europe and the USA, OME has over 20 active researchers with strong links to the microscopy community. Funded by private and public research grants, OME has been a major force on the international microscopy stage since 2000.","fork":true,"url":"https://api.github.com/repos/dominikl/openmicroscopy","forks_url":"https://api.github.com/repos/dominikl/openmicroscopy/forks","keys_url":"https://api.github.com/repos/dominikl/openmicroscopy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dominikl/openmicroscopy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dominikl/openmicroscopy/teams","hooks_url":"https://api.github.com/repos/dominikl/openmicroscopy/hooks","issue_events_url":"https://api.github.com/repos/dominikl/openmicroscopy/issues/events{/number}","events_url":"https://api.github.com/repos/dominikl/openmicroscopy/events","assignees_url":"https://api.github.com/repos/dominikl/openmicroscopy/assignees{/user}","branches_url":"https://api.github.com/repos/dominikl/openmicroscopy/branches{/branch}","tags_url":"https://api.github.com/repos/dominikl/openmicroscopy/tags","blobs_url":"https://api.github.com/repos/dominikl/openmicroscopy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dominikl/openmicroscopy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dominikl/openmicroscopy/git/refs{/sha}","trees_url":"https://api.github.com/repos/dominikl/openmicroscopy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dominikl/openmicroscopy/statuses/{sha}","languages_url":"https://api.github.com/repos/dominikl/openmicroscopy/languages","stargazers_url":"https://api.github.com/repos/dominikl/openmicroscopy/stargazers","contributors_url":"https://api.github.com/repos/dominikl/openmicroscopy/contributors","subscribers_url":"https://api.github.com/repos/dominikl/openmicroscopy/subscribers","subscription_url":"https://api.github.com/repos/dominikl/openmicroscopy/subscription","commits_url":"https://api.github.com/repos/dominikl/openmicroscopy/commits{/sha}","git_commits_url":"https://api.github.com/repos/dominikl/openmicroscopy/git/commits{/sha}","comments_url":"https://api.github.com/repos/dominikl/openmicroscopy/comments{/number}","issue_comment_url":"https://api.github.com/repos/dominikl/openmicroscopy/issues/comments{/number}","contents_url":"https://api.github.com/repos/dominikl/openmicroscopy/contents/{+path}","compare_url":"https://api.github.com/repos/dominikl/openmicroscopy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dominikl/openmicroscopy/merges","archive_url":"https://api.github.com/repos/dominikl/openmicroscopy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dominikl/openmicroscopy/downloads","issues_url":"https://api.github.com/repos/dominikl/openmicroscopy/issues{/number}","pulls_url":"https://api.github.com/repos/dominikl/openmicroscopy/pulls{/number}","milestones_url":"https://api.github.com/repos/dominikl/openmicroscopy/milestones{/number}","notifications_url":"https://api.github.com/repos/dominikl/openmicroscopy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dominikl/openmicroscopy/labels{/name}","releases_url":"https://api.github.com/repos/dominikl/openmicroscopy/releases{/id}","deployments_url":"https://api.github.com/repos/dominikl/openmicroscopy/deployments","created_at":"2014-02-10T14:47:13Z","updated_at":"2015-02-06T10:38:20Z","pushed_at":"2017-01-12T14:31:20Z","git_url":"git://github.com/dominikl/openmicroscopy.git","ssh_url":"git@github.com:dominikl/openmicroscopy.git","clone_url":"https://github.com/dominikl/openmicroscopy.git","svn_url":"https://github.com/dominikl/openmicroscopy","homepage":"http://www.openmicroscopy.org","size":1964326,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"develop"}},"base":{"label":"openmicroscopy:develop","ref":"develop","sha":"f6cae2e56cf0fb05351b2be9128ddea23366c574","user":{"login":"openmicroscopy","id":975861,"avatar_url":"https://avatars.githubusercontent.com/u/975861?v=3","gravatar_id":"","url":"https://api.github.com/users/openmicroscopy","html_url":"https://github.com/openmicroscopy","followers_url":"https://api.github.com/users/openmicroscopy/followers","following_url":"https://api.github.com/users/openmicroscopy/following{/other_user}","gists_url":"https://api.github.com/users/openmicroscopy/gists{/gist_id}","starred_url":"https://api.github.com/users/openmicroscopy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openmicroscopy/subscriptions","organizations_url":"https://api.github.com/users/openmicroscopy/orgs","repos_url":"https://api.github.com/users/openmicroscopy/repos","events_url":"https://api.github.com/users/openmicroscopy/events{/privacy}","received_events_url":"https://api.github.com/users/openmicroscopy/received_events","type":"Organization","site_admin":false},"repo":{"id":2228226,"name":"openmicroscopy","full_name":"openmicroscopy/openmicroscopy","owner":{"login":"openmicroscopy","id":975861,"avatar_url":"https://avatars.githubusercontent.com/u/975861?v=3","gravatar_id":"","url":"https://api.github.com/users/openmicroscopy","html_url":"https://github.com/openmicroscopy","followers_url":"https://api.github.com/users/openmicroscopy/followers","following_url":"https://api.github.com/users/openmicroscopy/following{/other_user}","gists_url":"https://api.github.com/users/openmicroscopy/gists{/gist_id}","starred_url":"https://api.github.com/users/openmicroscopy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openmicroscopy/subscriptions","organizations_url":"https://api.github.com/users/openmicroscopy/orgs","repos_url":"https://api.github.com/users/openmicroscopy/repos","events_url":"https://api.github.com/users/openmicroscopy/events{/privacy}","received_events_url":"https://api.github.com/users/openmicroscopy/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/openmicroscopy/openmicroscopy","description":"OME (Open Microscopy Environment) develops open-source software and data format standards for the storage and manipulation of biological light microscopy data. A joint project between universities, research establishments and industry in Europe and the USA, OME has over 20 active researchers with strong links to the microscopy community. Funded by private and public research grants, OME has been a major force on the international microscopy stage since 2000.","fork":false,"url":"https://api.github.com/repos/openmicroscopy/openmicroscopy","forks_url":"https://api.github.com/repos/openmicroscopy/openmicroscopy/forks","keys_url":"https://api.github.com/repos/openmicroscopy/openmicroscopy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/openmicroscopy/openmicroscopy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/openmicroscopy/openmicroscopy/teams","hooks_url":"https://api.github.com/repos/openmicroscopy/openmicroscopy/hooks","issue_events_url":"https://api.github.com/repos/openmicroscopy/openmicroscopy/issues/events{/number}","events_url":"https://api.github.com/repos/openmicroscopy/openmicroscopy/events","assignees_url":"https://api.github.com/repos/openmicroscopy/openmicroscopy/assignees{/user}","branches_url":"https://api.github.com/repos/openmicroscopy/openmicroscopy/branches{/branch}","tags_url":"https://api.github.com/repos/openmicroscopy/openmicroscopy/tags","blobs_url":"https://api.github.com/repos/openmicroscopy/openmicroscopy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/openmicroscopy/openmicroscopy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/openmicroscopy/openmicroscopy/git/refs{/sha}","trees_url":"https://api.github.com/repos/openmicroscopy/openmicroscopy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/openmicroscopy/openmicroscopy/statuses/{sha}","languages_url":"https://api.github.com/repos/openmicroscopy/openmicroscopy/languages","stargazers_url":"https://api.github.com/repos/openmicroscopy/openmicroscopy/stargazers","contributors_url":"https://api.github.com/repos/openmicroscopy/openmicroscopy/contributors","subscribers_url":"https://api.github.com/repos/openmicroscopy/openmicroscopy/subscribers","subscription_url":"https://api.github.com/repos/openmicroscopy/openmicroscopy/subscription","commits_url":"https://api.github.com/repos/openmicroscopy/openmicroscopy/commits{/sha}","git_commits_url":"https://api.github.com/repos/openmicroscopy/openmicroscopy/git/commits{/sha}","comments_url":"https://api.github.com/repos/openmicroscopy/openmicroscopy/comments{/number}","issue_comment_url":"https://api.github.com/repos/openmicroscopy/openmicroscopy/issues/comments{/number}","contents_url":"https://api.github.com/repos/openmicroscopy/openmicroscopy/contents/{+path}","compare_url":"https://api.github.com/repos/openmicroscopy/openmicroscopy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/openmicroscopy/openmicroscopy/merges","archive_url":"https://api.github.com/repos/openmicroscopy/openmicroscopy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/openmicroscopy/openmicroscopy/downloads","issues_url":"https://api.github.com/repos/openmicroscopy/openmicroscopy/issues{/number}","pulls_url":"https://api.github.com/repos/openmicroscopy/openmicroscopy/pulls{/number}","milestones_url":"https://api.github.com/repos/openmicroscopy/openmicroscopy/milestones{/number}","notifications_url":"https://api.github.com/repos/openmicroscopy/openmicroscopy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/openmicroscopy/openmicroscopy/labels{/name}","releases_url":"https://api.github.com/repos/openmicroscopy/openmicroscopy/releases{/id}","deployments_url":"https://api.github.com/repos/openmicroscopy/openmicroscopy/deployments","created_at":"2011-08-18T14:26:02Z","updated_at":"2016-12-24T21:26:52Z","pushed_at":"2017-01-12T16:28:44Z","git_url":"git://github.com/openmicroscopy/openmicroscopy.git","ssh_url":"git@github.com:openmicroscopy/openmicroscopy.git","clone_url":"https://github.com/openmicroscopy/openmicroscopy.git","svn_url":"https://github.com/openmicroscopy/openmicroscopy","homepage":"http://www.openmicroscopy.org","size":1969849,"stargazers_count":90,"watchers_count":90,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":77,"mirror_url":null,"open_issues_count":27,"forks":77,"open_issues":27,"watchers":90,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/openmicroscopy/openmicroscopy/pulls/5023"},"html":{"href":"https://github.com/openmicroscopy/openmicroscopy/pull/5023"},"issue":{"href":"https://api.github.com/repos/openmicroscopy/openmicroscopy/issues/5023"},"comments":{"href":"https://api.github.com/repos/openmicroscopy/openmicroscopy/issues/5023/comments"},"review_comments":{"href":"https://api.github.com/repos/openmicroscopy/openmicroscopy/pulls/5023/comments"},"review_comment":{"href":"https://api.github.com/repos/openmicroscopy/openmicroscopy/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/openmicroscopy/openmicroscopy/pulls/5023/commits"},"statuses":{"href":"https://api.github.com/repos/openmicroscopy/openmicroscopy/statuses/c99b0e5c0e7535326d947cc4f0e04666cf938234"}}}}
{"actor":{"display_login":"aleksandra-tarkowska"}}