GitHub PullRequestReviewCommentEvent at 2014-10-03 12:52:48
Repository: compassion-modules
Actor: ecino
Payload: {"action":"created","comment":{"url":"https://api.github.com/repos/CompassionCH/compassion-modules/pulls/comments/18392935","id":18392935,"diff_hunk":"@@ -0,0 +1,405 @@\n+﻿# -*- coding: utf-8 -*-\r\n+##############################################################################\r\n+#\r\n+#    Author: Cyril Sester. Copyright Compassion Suisse\r\n+#\r\n+#    This program is free software: you can redistribute it and/or modify\r\n+#    it under the terms of the GNU Affero General Public License as\r\n+#    published by the Free Software Foundation, either version 3 of the\r\n+#    License, or (at your option) any later version.\r\n+#\r\n+#    This program is distributed in the hope that it will be useful,\r\n+#    but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n+#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r\n+#    GNU Affero General Public License for more details.\r\n+#\r\n+#    You should have received a copy of the GNU Affero General Public License\r\n+#    along with this program.  If not, see <http://www.gnu.org/licenses/>.\r\n+#\r\n+##############################################################################\r\n+\r\n+\r\n+class Child_description_de:\r\n+\r\n+    @classmethod\r\n+    def gen_de_translation(\r\n+            cls, cr, uid, child, case_study, context=None):\r\n+        desc_de = cls._get_guardians_info_de(\r\n+            cr, uid, child, case_study, context)\r\n+        desc_de += cls._get_school_info_de(\r\n+            cr, uid, child, case_study, context)\r\n+        desc_de += cls._gen_christ_act_de(cr, uid, child, case_study, context)\r\n+        desc_de += cls._gen_family_act_info_de(\r\n+            cr, uid, child, case_study, context)\r\n+        desc_de += cls._gen_hobbies_info_de(\r\n+            cr, uid, child, case_study, context)\r\n+        return desc_de\r\n+\r\n+    @classmethod\r\n+    def _gen_christ_act_de(cls, cr, uid, child, case_study, context=None):\r\n+        ''' Generate the christian activities description part.\r\n+            possible values:\r\n+                Sunday School/Church\r\n+                Bible Class \r\n+                Camp\r\n+                Youth Group\r\n+                Vacation Bible School\r\n+                Choir\r\n+                There is also free text for other Christian activities.\r\n+        '''\r\n+        if child.gender == 'M':\r\n+            pronoun = 'er'\r\n+        else:\r\n+            pronoun = 'sie'\r\n+\r\n+        if not case_study.christian_activities_ids:\r\n+            return ''\r\n+        activities = [\r\n+            activity.value_de if activity.value_de else activity.value_en\r\n+            for activity in case_study.christian_activities_ids]\r\n+        activities_str = cls._gen_list_string(activities, ', ', ' und ')\r\n+        string = u\"In der Kirche macht %s %s. \" % (\r\n+            pronoun, activities_str)\r\n+        return string\r\n+\r\n+    @classmethod\r\n+    def _gen_family_act_info_de(\r\n+            cls, cr, uid, child, case_study, context=None):\r\n+        ''' Generate the family duties description part. There are 2 kind of\r\n+            activities:\r\n+             - Standards : introduced by 'erledigt' and having\r\n+                the determinant in value_de\r\n+             - Specials : having the action verb included in value_de\r\n+        possible values:\r\n+                Washing Clothes\r\n+                Making Beds\r\n+                Cleaning\r\n+                Carries Water\r\n+                Kitchen Help\r\n+                Animal Care\r\n+                Running Errands\r\n+                Child Care\r\n+                Buying/Selling in Market\r\n+                Gathers Firewood\r\n+                Gardening/Farming\r\n+                Sewing\r\n+                Teaching Others\r\n+                There is also free text for other family duties.\r\n+        '''\r\n+        if not case_study.family_duties_ids:\r\n+            return ''\r\n+        specials = ['carries water', 'animal care', 'running errands',\r\n+                    'buying/selling in market'\r\n+                    'gathers firewood', 'teaching others']\r\n+        activities = [activity.value_de if activity.value_de\r\n+                      else activity.value_en\r\n+                      for activity in case_study.family_duties_ids\r\n+                      if activity.value_en not in specials]\r\n+        if len(activities):\r","path":"child_compassion/wizard/child_description_de.py","position":98,"original_position":98,"commit_id":"77fbb953811a1c7a4a48c1e91005d9536c0bc77f","original_commit_id":"77fbb953811a1c7a4a48c1e91005d9536c0bc77f","user":{"login":"ecino","id":8435180,"avatar_url":"https://avatars.githubusercontent.com/u/8435180?v=2","gravatar_id":"","url":"https://api.github.com/users/ecino","html_url":"https://github.com/ecino","followers_url":"https://api.github.com/users/ecino/followers","following_url":"https://api.github.com/users/ecino/following{/other_user}","gists_url":"https://api.github.com/users/ecino/gists{/gist_id}","starred_url":"https://api.github.com/users/ecino/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ecino/subscriptions","organizations_url":"https://api.github.com/users/ecino/orgs","repos_url":"https://api.github.com/users/ecino/repos","events_url":"https://api.github.com/users/ecino/events{/privacy}","received_events_url":"https://api.github.com/users/ecino/received_events","type":"User","site_admin":false},"body":"You can replace by\r\n if(activities)\r\nEmpty lists return False.","created_at":"2014-10-03T12:52:48Z","updated_at":"2014-10-03T12:52:48Z","html_url":"https://github.com/CompassionCH/compassion-modules/pull/16#discussion_r18392935","pull_request_url":"https://api.github.com/repos/CompassionCH/compassion-modules/pulls/16","_links":{"self":{"href":"https://api.github.com/repos/CompassionCH/compassion-modules/pulls/comments/18392935"},"html":{"href":"https://github.com/CompassionCH/compassion-modules/pull/16#discussion_r18392935"},"pull_request":{"href":"https://api.github.com/repos/CompassionCH/compassion-modules/pulls/16"}}},"pull_request":{"url":"https://api.github.com/repos/CompassionCH/compassion-modules/pulls/16","id":22192930,"html_url":"https://github.com/CompassionCH/compassion-modules/pull/16","diff_url":"https://github.com/CompassionCH/compassion-modules/pull/16.diff","patch_url":"https://github.com/CompassionCH/compassion-modules/pull/16.patch","issue_url":"https://api.github.com/repos/CompassionCH/compassion-modules/issues/16","number":16,"state":"open","locked":false,"title":"Compassion projects","user":{"login":"KCristi","id":8790915,"avatar_url":"https://avatars.githubusercontent.com/u/8790915?v=2","gravatar_id":"","url":"https://api.github.com/users/KCristi","html_url":"https://github.com/KCristi","followers_url":"https://api.github.com/users/KCristi/followers","following_url":"https://api.github.com/users/KCristi/following{/other_user}","gists_url":"https://api.github.com/users/KCristi/gists{/gist_id}","starred_url":"https://api.github.com/users/KCristi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KCristi/subscriptions","organizations_url":"https://api.github.com/users/KCristi/orgs","repos_url":"https://api.github.com/users/KCristi/repos","events_url":"https://api.github.com/users/KCristi/events{/privacy}","received_events_url":"https://api.github.com/users/KCristi/received_events","type":"User","site_admin":false},"body":"","created_at":"2014-10-03T09:07:13Z","updated_at":"2014-10-03T12:52:49Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c417187202b2b798584c8dd0b4efb94cd5963ce3","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/CompassionCH/compassion-modules/pulls/16/commits","review_comments_url":"https://api.github.com/repos/CompassionCH/compassion-modules/pulls/16/comments","review_comment_url":"https://api.github.com/repos/CompassionCH/compassion-modules/pulls/comments/{number}","comments_url":"https://api.github.com/repos/CompassionCH/compassion-modules/issues/16/comments","statuses_url":"https://api.github.com/repos/CompassionCH/compassion-modules/statuses/77fbb953811a1c7a4a48c1e91005d9536c0bc77f","head":{"label":"KCristi:compassion-projects","ref":"compassion-projects","sha":"77fbb953811a1c7a4a48c1e91005d9536c0bc77f","user":{"login":"KCristi","id":8790915,"avatar_url":"https://avatars.githubusercontent.com/u/8790915?v=2","gravatar_id":"","url":"https://api.github.com/users/KCristi","html_url":"https://github.com/KCristi","followers_url":"https://api.github.com/users/KCristi/followers","following_url":"https://api.github.com/users/KCristi/following{/other_user}","gists_url":"https://api.github.com/users/KCristi/gists{/gist_id}","starred_url":"https://api.github.com/users/KCristi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KCristi/subscriptions","organizations_url":"https://api.github.com/users/KCristi/orgs","repos_url":"https://api.github.com/users/KCristi/repos","events_url":"https://api.github.com/users/KCristi/events{/privacy}","received_events_url":"https://api.github.com/users/KCristi/received_events","type":"User","site_admin":false},"repo":{"id":24094231,"name":"compassion-modules","full_name":"KCristi/compassion-modules","owner":{"login":"KCristi","id":8790915,"avatar_url":"https://avatars.githubusercontent.com/u/8790915?v=2","gravatar_id":"","url":"https://api.github.com/users/KCristi","html_url":"https://github.com/KCristi","followers_url":"https://api.github.com/users/KCristi/followers","following_url":"https://api.github.com/users/KCristi/following{/other_user}","gists_url":"https://api.github.com/users/KCristi/gists{/gist_id}","starred_url":"https://api.github.com/users/KCristi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KCristi/subscriptions","organizations_url":"https://api.github.com/users/KCristi/orgs","repos_url":"https://api.github.com/users/KCristi/repos","events_url":"https://api.github.com/users/KCristi/events{/privacy}","received_events_url":"https://api.github.com/users/KCristi/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/KCristi/compassion-modules","description":"","fork":true,"url":"https://api.github.com/repos/KCristi/compassion-modules","forks_url":"https://api.github.com/repos/KCristi/compassion-modules/forks","keys_url":"https://api.github.com/repos/KCristi/compassion-modules/keys{/key_id}","collaborators_url":"https://api.github.com/repos/KCristi/compassion-modules/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/KCristi/compassion-modules/teams","hooks_url":"https://api.github.com/repos/KCristi/compassion-modules/hooks","issue_events_url":"https://api.github.com/repos/KCristi/compassion-modules/issues/events{/number}","events_url":"https://api.github.com/repos/KCristi/compassion-modules/events","assignees_url":"https://api.github.com/repos/KCristi/compassion-modules/assignees{/user}","branches_url":"https://api.github.com/repos/KCristi/compassion-modules/branches{/branch}","tags_url":"https://api.github.com/repos/KCristi/compassion-modules/tags","blobs_url":"https://api.github.com/repos/KCristi/compassion-modules/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/KCristi/compassion-modules/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/KCristi/compassion-modules/git/refs{/sha}","trees_url":"https://api.github.com/repos/KCristi/compassion-modules/git/trees{/sha}","statuses_url":"https://api.github.com/repos/KCristi/compassion-modules/statuses/{sha}","languages_url":"https://api.github.com/repos/KCristi/compassion-modules/languages","stargazers_url":"https://api.github.com/repos/KCristi/compassion-modules/stargazers","contributors_url":"https://api.github.com/repos/KCristi/compassion-modules/contributors","subscribers_url":"https://api.github.com/repos/KCristi/compassion-modules/subscribers","subscription_url":"https://api.github.com/repos/KCristi/compassion-modules/subscription","commits_url":"https://api.github.com/repos/KCristi/compassion-modules/commits{/sha}","git_commits_url":"https://api.github.com/repos/KCristi/compassion-modules/git/commits{/sha}","comments_url":"https://api.github.com/repos/KCristi/compassion-modules/comments{/number}","issue_comment_url":"https://api.github.com/repos/KCristi/compassion-modules/issues/comments/{number}","contents_url":"https://api.github.com/repos/KCristi/compassion-modules/contents/{+path}","compare_url":"https://api.github.com/repos/KCristi/compassion-modules/compare/{base}...{head}","merges_url":"https://api.github.com/repos/KCristi/compassion-modules/merges","archive_url":"https://api.github.com/repos/KCristi/compassion-modules/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/KCristi/compassion-modules/downloads","issues_url":"https://api.github.com/repos/KCristi/compassion-modules/issues{/number}","pulls_url":"https://api.github.com/repos/KCristi/compassion-modules/pulls{/number}","milestones_url":"https://api.github.com/repos/KCristi/compassion-modules/milestones{/number}","notifications_url":"https://api.github.com/repos/KCristi/compassion-modules/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/KCristi/compassion-modules/labels{/name}","releases_url":"https://api.github.com/repos/KCristi/compassion-modules/releases{/id}","created_at":"2014-09-16T09:54:11Z","updated_at":"2014-09-16T13:23:36Z","pushed_at":"2014-10-03T09:04:32Z","git_url":"git://github.com/KCristi/compassion-modules.git","ssh_url":"git@github.com:KCristi/compassion-modules.git","clone_url":"https://github.com/KCristi/compassion-modules.git","svn_url":"https://github.com/KCristi/compassion-modules","homepage":null,"size":439,"stargazers_count":0,"watchers_count":0,"language":"Python","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":"7.0"}},"base":{"label":"CompassionCH:compassion-projects","ref":"compassion-projects","sha":"3bb24c68162fa0f9f77802bc13010d2f73527a0f","user":{"login":"CompassionCH","id":8435213,"avatar_url":"https://avatars.githubusercontent.com/u/8435213?v=2","gravatar_id":"","url":"https://api.github.com/users/CompassionCH","html_url":"https://github.com/CompassionCH","followers_url":"https://api.github.com/users/CompassionCH/followers","following_url":"https://api.github.com/users/CompassionCH/following{/other_user}","gists_url":"https://api.github.com/users/CompassionCH/gists{/gist_id}","starred_url":"https://api.github.com/users/CompassionCH/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CompassionCH/subscriptions","organizations_url":"https://api.github.com/users/CompassionCH/orgs","repos_url":"https://api.github.com/users/CompassionCH/repos","events_url":"https://api.github.com/users/CompassionCH/events{/privacy}","received_events_url":"https://api.github.com/users/CompassionCH/received_events","type":"Organization","site_admin":false},"repo":{"id":23073482,"name":"compassion-modules","full_name":"CompassionCH/compassion-modules","owner":{"login":"CompassionCH","id":8435213,"avatar_url":"https://avatars.githubusercontent.com/u/8435213?v=2","gravatar_id":"","url":"https://api.github.com/users/CompassionCH","html_url":"https://github.com/CompassionCH","followers_url":"https://api.github.com/users/CompassionCH/followers","following_url":"https://api.github.com/users/CompassionCH/following{/other_user}","gists_url":"https://api.github.com/users/CompassionCH/gists{/gist_id}","starred_url":"https://api.github.com/users/CompassionCH/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CompassionCH/subscriptions","organizations_url":"https://api.github.com/users/CompassionCH/orgs","repos_url":"https://api.github.com/users/CompassionCH/repos","events_url":"https://api.github.com/users/CompassionCH/events{/privacy}","received_events_url":"https://api.github.com/users/CompassionCH/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/CompassionCH/compassion-modules","description":"","fork":false,"url":"https://api.github.com/repos/CompassionCH/compassion-modules","forks_url":"https://api.github.com/repos/CompassionCH/compassion-modules/forks","keys_url":"https://api.github.com/repos/CompassionCH/compassion-modules/keys{/key_id}","collaborators_url":"https://api.github.com/repos/CompassionCH/compassion-modules/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/CompassionCH/compassion-modules/teams","hooks_url":"https://api.github.com/repos/CompassionCH/compassion-modules/hooks","issue_events_url":"https://api.github.com/repos/CompassionCH/compassion-modules/issues/events{/number}","events_url":"https://api.github.com/repos/CompassionCH/compassion-modules/events","assignees_url":"https://api.github.com/repos/CompassionCH/compassion-modules/assignees{/user}","branches_url":"https://api.github.com/repos/CompassionCH/compassion-modules/branches{/branch}","tags_url":"https://api.github.com/repos/CompassionCH/compassion-modules/tags","blobs_url":"https://api.github.com/repos/CompassionCH/compassion-modules/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/CompassionCH/compassion-modules/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/CompassionCH/compassion-modules/git/refs{/sha}","trees_url":"https://api.github.com/repos/CompassionCH/compassion-modules/git/trees{/sha}","statuses_url":"https://api.github.com/repos/CompassionCH/compassion-modules/statuses/{sha}","languages_url":"https://api.github.com/repos/CompassionCH/compassion-modules/languages","stargazers_url":"https://api.github.com/repos/CompassionCH/compassion-modules/stargazers","contributors_url":"https://api.github.com/repos/CompassionCH/compassion-modules/contributors","subscribers_url":"https://api.github.com/repos/CompassionCH/compassion-modules/subscribers","subscription_url":"https://api.github.com/repos/CompassionCH/compassion-modules/subscription","commits_url":"https://api.github.com/repos/CompassionCH/compassion-modules/commits{/sha}","git_commits_url":"https://api.github.com/repos/CompassionCH/compassion-modules/git/commits{/sha}","comments_url":"https://api.github.com/repos/CompassionCH/compassion-modules/comments{/number}","issue_comment_url":"https://api.github.com/repos/CompassionCH/compassion-modules/issues/comments/{number}","contents_url":"https://api.github.com/repos/CompassionCH/compassion-modules/contents/{+path}","compare_url":"https://api.github.com/repos/CompassionCH/compassion-modules/compare/{base}...{head}","merges_url":"https://api.github.com/repos/CompassionCH/compassion-modules/merges","archive_url":"https://api.github.com/repos/CompassionCH/compassion-modules/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/CompassionCH/compassion-modules/downloads","issues_url":"https://api.github.com/repos/CompassionCH/compassion-modules/issues{/number}","pulls_url":"https://api.github.com/repos/CompassionCH/compassion-modules/pulls{/number}","milestones_url":"https://api.github.com/repos/CompassionCH/compassion-modules/milestones{/number}","notifications_url":"https://api.github.com/repos/CompassionCH/compassion-modules/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/CompassionCH/compassion-modules/labels{/name}","releases_url":"https://api.github.com/repos/CompassionCH/compassion-modules/releases{/id}","created_at":"2014-08-18T14:08:09Z","updated_at":"2014-09-15T08:44:36Z","pushed_at":"2014-10-01T14:10:54Z","git_url":"git://github.com/CompassionCH/compassion-modules.git","ssh_url":"git@github.com:CompassionCH/compassion-modules.git","clone_url":"https://github.com/CompassionCH/compassion-modules.git","svn_url":"https://github.com/CompassionCH/compassion-modules","homepage":null,"size":1065,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":1,"forks":1,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/CompassionCH/compassion-modules/pulls/16"},"html":{"href":"https://github.com/CompassionCH/compassion-modules/pull/16"},"issue":{"href":"https://api.github.com/repos/CompassionCH/compassion-modules/issues/16"},"comments":{"href":"https://api.github.com/repos/CompassionCH/compassion-modules/issues/16/comments"},"review_comments":{"href":"https://api.github.com/repos/CompassionCH/compassion-modules/pulls/16/comments"},"review_comment":{"href":"https://api.github.com/repos/CompassionCH/compassion-modules/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/CompassionCH/compassion-modules/pulls/16/commits"},"statuses":{"href":"https://api.github.com/repos/CompassionCH/compassion-modules/statuses/77fbb953811a1c7a4a48c1e91005d9536c0bc77f"}}}}