{"action":"created","comment":{"url":"https://api.github.com/repos/lanmomo/lanmomo-website/pulls/comments/40986021","id":40986021,"diff_hunk":"@@ -116,6 +116,72 @@ def __init__(self, ticket_id, reserved_until=None, reserved_at=None):\n     def __repr__(self):\n         return '<Seat %r>' % (self.id)\n \n+\n+class Team():\n+    query = db_session.query_property()\n+\n+    def __init__(self, name, game, captain_id):\n+            self.name = name\n+            self.game = game\n+            self.captain_id = captain_id\n+            self.created_date = datetime.now\n+\n+    def __repr__(self):\n+            return '<Team %r>' % (self.name)\n+\n+    def get_captain_name(self):\n+        user = User.query.filter(User.id == self.captain_id).first()\n+        if user:\n+            return user.as_pub_dict()['username']\n+\n+    def as_pub_dict(self):\n+            pub_dict = {\n+                'name': self.name,\n+                'game': self.game,\n+                'captain_id': self.get_captain_name(),\n+                }\n+            return pub_dict\n+\n+class TeamUser():\n+    query = db_session.query_property()\n+\n+    def __init__(self, team_id, user_id, accepted=False):\n+            self.team_id = team_id\n+            self.user_id = user_id\n+            self.accepted = accepted\n+\n+    def __repr__(self):\n+            return '<Team-User %r - %r>' % (self.team_id, self.user_id)\n+\n+    def get_team_name(self):\n+        team = User.query.filter(Team.id == self.team_id).first()\n+        if team:\n+            return user.as_pub_dict()['name']","path":"models.py","position":44,"original_position":44,"commit_id":"9278c9eded0a72bdc9fd4d0d20ae65211bbc1cba","original_commit_id":"9278c9eded0a72bdc9fd4d0d20ae65211bbc1cba","user":{"login":"jdupl","id":4731264,"avatar_url":"https://avatars.githubusercontent.com/u/4731264?v=3","gravatar_id":"","url":"https://api.github.com/users/jdupl","html_url":"https://github.com/jdupl","followers_url":"https://api.github.com/users/jdupl/followers","following_url":"https://api.github.com/users/jdupl/following{/other_user}","gists_url":"https://api.github.com/users/jdupl/gists{/gist_id}","starred_url":"https://api.github.com/users/jdupl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jdupl/subscriptions","organizations_url":"https://api.github.com/users/jdupl/orgs","repos_url":"https://api.github.com/users/jdupl/repos","events_url":"https://api.github.com/users/jdupl/events{/privacy}","received_events_url":"https://api.github.com/users/jdupl/received_events","type":"User","site_admin":false},"body":"Techniquement, pas besoin de les mettre en public dict: `user.name` fonctionnerait","created_at":"2015-10-02T01:50:50Z","updated_at":"2015-10-02T01:50:50Z","html_url":"https://github.com/lanmomo/lanmomo-website/pull/189#discussion_r40986021","pull_request_url":"https://api.github.com/repos/lanmomo/lanmomo-website/pulls/189","_links":{"self":{"href":"https://api.github.com/repos/lanmomo/lanmomo-website/pulls/comments/40986021"},"html":{"href":"https://github.com/lanmomo/lanmomo-website/pull/189#discussion_r40986021"},"pull_request":{"href":"https://api.github.com/repos/lanmomo/lanmomo-website/pulls/189"}}},"pull_request":{"url":"https://api.github.com/repos/lanmomo/lanmomo-website/pulls/189","id":46596460,"html_url":"https://github.com/lanmomo/lanmomo-website/pull/189","diff_url":"https://github.com/lanmomo/lanmomo-website/pull/189.diff","patch_url":"https://github.com/lanmomo/lanmomo-website/pull/189.patch","issue_url":"https://api.github.com/repos/lanmomo/lanmomo-website/issues/189","number":189,"state":"open","locked":false,"title":"Tournament","user":{"login":"Kiniamaro","id":3664099,"avatar_url":"https://avatars.githubusercontent.com/u/3664099?v=3","gravatar_id":"","url":"https://api.github.com/users/Kiniamaro","html_url":"https://github.com/Kiniamaro","followers_url":"https://api.github.com/users/Kiniamaro/followers","following_url":"https://api.github.com/users/Kiniamaro/following{/other_user}","gists_url":"https://api.github.com/users/Kiniamaro/gists{/gist_id}","starred_url":"https://api.github.com/users/Kiniamaro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Kiniamaro/subscriptions","organizations_url":"https://api.github.com/users/Kiniamaro/orgs","repos_url":"https://api.github.com/users/Kiniamaro/repos","events_url":"https://api.github.com/users/Kiniamaro/events{/privacy}","received_events_url":"https://api.github.com/users/Kiniamaro/received_events","type":"User","site_admin":false},"body":"Pour le moment les jouers peuvent seulement creer une equipe et devenir son capitaine, ils ont par la suite la possibilite de supprimer leurs equipe si ils le desirent.\r\n\r\nprochainement je vais ajouter l'option de pouvoir rejoindre une equipe et ensuite d'afficher ses membres dans la liste.\r\n![2015-10-01-214554_1631x937_scrot](https://cloud.githubusercontent.com/assets/3664099/10237866/e4991786-6885-11e5-928e-b07cea29a776.png)\r\n![2015-10-01-214608_1584x589_scrot](https://cloud.githubusercontent.com/assets/3664099/10237867/e4a74cd4-6885-11e5-988c-c8b6f2e96c54.png)\r\n![2015-10-01-214624_1648x856_scrot](https://cloud.githubusercontent.com/assets/3664099/10237868/e4a74860-6885-11e5-948c-067a1d3a0b29.png)\r\n","created_at":"2015-10-02T01:46:56Z","updated_at":"2015-10-02T01:50:50Z","closed_at":null,"merged_at":null,"merge_commit_sha":"261b3e32d38b2398a210c55b3992b76aaa285eb8","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/lanmomo/lanmomo-website/pulls/189/commits","review_comments_url":"https://api.github.com/repos/lanmomo/lanmomo-website/pulls/189/comments","review_comment_url":"https://api.github.com/repos/lanmomo/lanmomo-website/pulls/comments{/number}","comments_url":"https://api.github.com/repos/lanmomo/lanmomo-website/issues/189/comments","statuses_url":"https://api.github.com/repos/lanmomo/lanmomo-website/statuses/9278c9eded0a72bdc9fd4d0d20ae65211bbc1cba","head":{"label":"lanmomo:tournament","ref":"tournament","sha":"9278c9eded0a72bdc9fd4d0d20ae65211bbc1cba","user":{"login":"lanmomo","id":10793269,"avatar_url":"https://avatars.githubusercontent.com/u/10793269?v=3","gravatar_id":"","url":"https://api.github.com/users/lanmomo","html_url":"https://github.com/lanmomo","followers_url":"https://api.github.com/users/lanmomo/followers","following_url":"https://api.github.com/users/lanmomo/following{/other_user}","gists_url":"https://api.github.com/users/lanmomo/gists{/gist_id}","starred_url":"https://api.github.com/users/lanmomo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lanmomo/subscriptions","organizations_url":"https://api.github.com/users/lanmomo/orgs","repos_url":"https://api.github.com/users/lanmomo/repos","events_url":"https://api.github.com/users/lanmomo/events{/privacy}","received_events_url":"https://api.github.com/users/lanmomo/received_events","type":"Organization","site_admin":false},"repo":{"id":30136445,"name":"lanmomo-website","full_name":"lanmomo/lanmomo-website","owner":{"login":"lanmomo","id":10793269,"avatar_url":"https://avatars.githubusercontent.com/u/10793269?v=3","gravatar_id":"","url":"https://api.github.com/users/lanmomo","html_url":"https://github.com/lanmomo","followers_url":"https://api.github.com/users/lanmomo/followers","following_url":"https://api.github.com/users/lanmomo/following{/other_user}","gists_url":"https://api.github.com/users/lanmomo/gists{/gist_id}","starred_url":"https://api.github.com/users/lanmomo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lanmomo/subscriptions","organizations_url":"https://api.github.com/users/lanmomo/orgs","repos_url":"https://api.github.com/users/lanmomo/repos","events_url":"https://api.github.com/users/lanmomo/events{/privacy}","received_events_url":"https://api.github.com/users/lanmomo/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/lanmomo/lanmomo-website","description":"Website for LAN Montmorency.","fork":false,"url":"https://api.github.com/repos/lanmomo/lanmomo-website","forks_url":"https://api.github.com/repos/lanmomo/lanmomo-website/forks","keys_url":"https://api.github.com/repos/lanmomo/lanmomo-website/keys{/key_id}","collaborators_url":"https://api.github.com/repos/lanmomo/lanmomo-website/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/lanmomo/lanmomo-website/teams","hooks_url":"https://api.github.com/repos/lanmomo/lanmomo-website/hooks","issue_events_url":"https://api.github.com/repos/lanmomo/lanmomo-website/issues/events{/number}","events_url":"https://api.github.com/repos/lanmomo/lanmomo-website/events","assignees_url":"https://api.github.com/repos/lanmomo/lanmomo-website/assignees{/user}","branches_url":"https://api.github.com/repos/lanmomo/lanmomo-website/branches{/branch}","tags_url":"https://api.github.com/repos/lanmomo/lanmomo-website/tags","blobs_url":"https://api.github.com/repos/lanmomo/lanmomo-website/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/lanmomo/lanmomo-website/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/lanmomo/lanmomo-website/git/refs{/sha}","trees_url":"https://api.github.com/repos/lanmomo/lanmomo-website/git/trees{/sha}","statuses_url":"https://api.github.com/repos/lanmomo/lanmomo-website/statuses/{sha}","languages_url":"https://api.github.com/repos/lanmomo/lanmomo-website/languages","stargazers_url":"https://api.github.com/repos/lanmomo/lanmomo-website/stargazers","contributors_url":"https://api.github.com/repos/lanmomo/lanmomo-website/contributors","subscribers_url":"https://api.github.com/repos/lanmomo/lanmomo-website/subscribers","subscription_url":"https://api.github.com/repos/lanmomo/lanmomo-website/subscription","commits_url":"https://api.github.com/repos/lanmomo/lanmomo-website/commits{/sha}","git_commits_url":"https://api.github.com/repos/lanmomo/lanmomo-website/git/commits{/sha}","comments_url":"https://api.github.com/repos/lanmomo/lanmomo-website/comments{/number}","issue_comment_url":"https://api.github.com/repos/lanmomo/lanmomo-website/issues/comments{/number}","contents_url":"https://api.github.com/repos/lanmomo/lanmomo-website/contents/{+path}","compare_url":"https://api.github.com/repos/lanmomo/lanmomo-website/compare/{base}...{head}","merges_url":"https://api.github.com/repos/lanmomo/lanmomo-website/merges","archive_url":"https://api.github.com/repos/lanmomo/lanmomo-website/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/lanmomo/lanmomo-website/downloads","issues_url":"https://api.github.com/repos/lanmomo/lanmomo-website/issues{/number}","pulls_url":"https://api.github.com/repos/lanmomo/lanmomo-website/pulls{/number}","milestones_url":"https://api.github.com/repos/lanmomo/lanmomo-website/milestones{/number}","notifications_url":"https://api.github.com/repos/lanmomo/lanmomo-website/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/lanmomo/lanmomo-website/labels{/name}","releases_url":"https://api.github.com/repos/lanmomo/lanmomo-website/releases{/id}","created_at":"2015-02-01T04:41:26Z","updated_at":"2015-04-17T01:43:09Z","pushed_at":"2015-10-02T01:47:32Z","git_url":"git://github.com/lanmomo/lanmomo-website.git","ssh_url":"git@github.com:lanmomo/lanmomo-website.git","clone_url":"https://github.com/lanmomo/lanmomo-website.git","svn_url":"https://github.com/lanmomo/lanmomo-website","homepage":"https://lanmomo.ca/","size":5822,"stargazers_count":2,"watchers_count":2,"language":"HTML","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":5,"mirror_url":null,"open_issues_count":16,"forks":5,"open_issues":16,"watchers":2,"default_branch":"master"}},"base":{"label":"lanmomo:master","ref":"master","sha":"672c10de9132e8aaa7686428249eb43a9a17904e","user":{"login":"lanmomo","id":10793269,"avatar_url":"https://avatars.githubusercontent.com/u/10793269?v=3","gravatar_id":"","url":"https://api.github.com/users/lanmomo","html_url":"https://github.com/lanmomo","followers_url":"https://api.github.com/users/lanmomo/followers","following_url":"https://api.github.com/users/lanmomo/following{/other_user}","gists_url":"https://api.github.com/users/lanmomo/gists{/gist_id}","starred_url":"https://api.github.com/users/lanmomo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lanmomo/subscriptions","organizations_url":"https://api.github.com/users/lanmomo/orgs","repos_url":"https://api.github.com/users/lanmomo/repos","events_url":"https://api.github.com/users/lanmomo/events{/privacy}","received_events_url":"https://api.github.com/users/lanmomo/received_events","type":"Organization","site_admin":false},"repo":{"id":30136445,"name":"lanmomo-website","full_name":"lanmomo/lanmomo-website","owner":{"login":"lanmomo","id":10793269,"avatar_url":"https://avatars.githubusercontent.com/u/10793269?v=3","gravatar_id":"","url":"https://api.github.com/users/lanmomo","html_url":"https://github.com/lanmomo","followers_url":"https://api.github.com/users/lanmomo/followers","following_url":"https://api.github.com/users/lanmomo/following{/other_user}","gists_url":"https://api.github.com/users/lanmomo/gists{/gist_id}","starred_url":"https://api.github.com/users/lanmomo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lanmomo/subscriptions","organizations_url":"https://api.github.com/users/lanmomo/orgs","repos_url":"https://api.github.com/users/lanmomo/repos","events_url":"https://api.github.com/users/lanmomo/events{/privacy}","received_events_url":"https://api.github.com/users/lanmomo/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/lanmomo/lanmomo-website","description":"Website for LAN Montmorency.","fork":false,"url":"https://api.github.com/repos/lanmomo/lanmomo-website","forks_url":"https://api.github.com/repos/lanmomo/lanmomo-website/forks","keys_url":"https://api.github.com/repos/lanmomo/lanmomo-website/keys{/key_id}","collaborators_url":"https://api.github.com/repos/lanmomo/lanmomo-website/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/lanmomo/lanmomo-website/teams","hooks_url":"https://api.github.com/repos/lanmomo/lanmomo-website/hooks","issue_events_url":"https://api.github.com/repos/lanmomo/lanmomo-website/issues/events{/number}","events_url":"https://api.github.com/repos/lanmomo/lanmomo-website/events","assignees_url":"https://api.github.com/repos/lanmomo/lanmomo-website/assignees{/user}","branches_url":"https://api.github.com/repos/lanmomo/lanmomo-website/branches{/branch}","tags_url":"https://api.github.com/repos/lanmomo/lanmomo-website/tags","blobs_url":"https://api.github.com/repos/lanmomo/lanmomo-website/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/lanmomo/lanmomo-website/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/lanmomo/lanmomo-website/git/refs{/sha}","trees_url":"https://api.github.com/repos/lanmomo/lanmomo-website/git/trees{/sha}","statuses_url":"https://api.github.com/repos/lanmomo/lanmomo-website/statuses/{sha}","languages_url":"https://api.github.com/repos/lanmomo/lanmomo-website/languages","stargazers_url":"https://api.github.com/repos/lanmomo/lanmomo-website/stargazers","contributors_url":"https://api.github.com/repos/lanmomo/lanmomo-website/contributors","subscribers_url":"https://api.github.com/repos/lanmomo/lanmomo-website/subscribers","subscription_url":"https://api.github.com/repos/lanmomo/lanmomo-website/subscription","commits_url":"https://api.github.com/repos/lanmomo/lanmomo-website/commits{/sha}","git_commits_url":"https://api.github.com/repos/lanmomo/lanmomo-website/git/commits{/sha}","comments_url":"https://api.github.com/repos/lanmomo/lanmomo-website/comments{/number}","issue_comment_url":"https://api.github.com/repos/lanmomo/lanmomo-website/issues/comments{/number}","contents_url":"https://api.github.com/repos/lanmomo/lanmomo-website/contents/{+path}","compare_url":"https://api.github.com/repos/lanmomo/lanmomo-website/compare/{base}...{head}","merges_url":"https://api.github.com/repos/lanmomo/lanmomo-website/merges","archive_url":"https://api.github.com/repos/lanmomo/lanmomo-website/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/lanmomo/lanmomo-website/downloads","issues_url":"https://api.github.com/repos/lanmomo/lanmomo-website/issues{/number}","pulls_url":"https://api.github.com/repos/lanmomo/lanmomo-website/pulls{/number}","milestones_url":"https://api.github.com/repos/lanmomo/lanmomo-website/milestones{/number}","notifications_url":"https://api.github.com/repos/lanmomo/lanmomo-website/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/lanmomo/lanmomo-website/labels{/name}","releases_url":"https://api.github.com/repos/lanmomo/lanmomo-website/releases{/id}","created_at":"2015-02-01T04:41:26Z","updated_at":"2015-04-17T01:43:09Z","pushed_at":"2015-10-02T01:47:32Z","git_url":"git://github.com/lanmomo/lanmomo-website.git","ssh_url":"git@github.com:lanmomo/lanmomo-website.git","clone_url":"https://github.com/lanmomo/lanmomo-website.git","svn_url":"https://github.com/lanmomo/lanmomo-website","homepage":"https://lanmomo.ca/","size":5822,"stargazers_count":2,"watchers_count":2,"language":"HTML","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":5,"mirror_url":null,"open_issues_count":16,"forks":5,"open_issues":16,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/lanmomo/lanmomo-website/pulls/189"},"html":{"href":"https://github.com/lanmomo/lanmomo-website/pull/189"},"issue":{"href":"https://api.github.com/repos/lanmomo/lanmomo-website/issues/189"},"comments":{"href":"https://api.github.com/repos/lanmomo/lanmomo-website/issues/189/comments"},"review_comments":{"href":"https://api.github.com/repos/lanmomo/lanmomo-website/pulls/189/comments"},"review_comment":{"href":"https://api.github.com/repos/lanmomo/lanmomo-website/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/lanmomo/lanmomo-website/pulls/189/commits"},"statuses":{"href":"https://api.github.com/repos/lanmomo/lanmomo-website/statuses/9278c9eded0a72bdc9fd4d0d20ae65211bbc1cba"}}}}