{"action":"created","comment":{"url":"https://api.github.com/repos/zestedesavoir/zds-site/pulls/comments/72887904","id":72887904,"diff_hunk":"@@ -35,12 +39,23 @@ class DetailKeyConstructor(DefaultKeyConstructor):\n     retrieve_sql_query = bits.RetrieveSqlQueryKeyBit()\n     unique_view_id = bits.UniqueViewIdKeyBit()\n     user = bits.UserKeyBit()\n+    updated_at = UpdatedAtKeyBit('api_updated_profile')\n \n \n class MyDetailKeyConstructor(DefaultKeyConstructor):\n     format = bits.FormatKeyBit()\n     language = bits.LanguageKeyBit()\n     user = bits.UserKeyBit()\n+    updated_at = UpdatedAtKeyBit('api_updated_profile')\n+\n+\n+def change_api_profile_updated_at(sender=None, instance=None, *args, **kwargs):\n+    cache.set('api_updated_profile', datetime.datetime.utcnow())\n+\n+\n+for model, func in [(Profile, change_api_profile_updated_at)]:","path":"zds/member/api/views.py","position":43,"original_position":43,"commit_id":"2cd1692882b99407682f2edd3f5be6f5acf4fca1","original_commit_id":"2cd1692882b99407682f2edd3f5be6f5acf4fca1","user":{"login":"GerardPaligot","id":1913901,"avatar_url":"https://avatars.githubusercontent.com/u/1913901?v=3","gravatar_id":"","url":"https://api.github.com/users/GerardPaligot","html_url":"https://github.com/GerardPaligot","followers_url":"https://api.github.com/users/GerardPaligot/followers","following_url":"https://api.github.com/users/GerardPaligot/following{/other_user}","gists_url":"https://api.github.com/users/GerardPaligot/gists{/gist_id}","starred_url":"https://api.github.com/users/GerardPaligot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GerardPaligot/subscriptions","organizations_url":"https://api.github.com/users/GerardPaligot/orgs","repos_url":"https://api.github.com/users/GerardPaligot/repos","events_url":"https://api.github.com/users/GerardPaligot/events{/privacy}","received_events_url":"https://api.github.com/users/GerardPaligot/received_events","type":"User","site_admin":false},"body":"Je comprends pas trop ce que tu me demandes :/","created_at":"2016-07-30T13:45:59Z","updated_at":"2016-07-30T13:45:59Z","html_url":"https://github.com/zestedesavoir/zds-site/pull/3755#discussion_r72887904","pull_request_url":"https://api.github.com/repos/zestedesavoir/zds-site/pulls/3755","_links":{"self":{"href":"https://api.github.com/repos/zestedesavoir/zds-site/pulls/comments/72887904"},"html":{"href":"https://github.com/zestedesavoir/zds-site/pull/3755#discussion_r72887904"},"pull_request":{"href":"https://api.github.com/repos/zestedesavoir/zds-site/pulls/3755"}}},"pull_request":{"url":"https://api.github.com/repos/zestedesavoir/zds-site/pulls/3755","id":79433335,"html_url":"https://github.com/zestedesavoir/zds-site/pull/3755","diff_url":"https://github.com/zestedesavoir/zds-site/pull/3755.diff","patch_url":"https://github.com/zestedesavoir/zds-site/pull/3755.patch","issue_url":"https://api.github.com/repos/zestedesavoir/zds-site/issues/3755","number":3755,"state":"open","locked":false,"title":"Invalide le cache de l'API à chaque entrée dans la base","user":{"login":"GerardPaligot","id":1913901,"avatar_url":"https://avatars.githubusercontent.com/u/1913901?v=3","gravatar_id":"","url":"https://api.github.com/users/GerardPaligot","html_url":"https://github.com/GerardPaligot","followers_url":"https://api.github.com/users/GerardPaligot/followers","following_url":"https://api.github.com/users/GerardPaligot/following{/other_user}","gists_url":"https://api.github.com/users/GerardPaligot/gists{/gist_id}","starred_url":"https://api.github.com/users/GerardPaligot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GerardPaligot/subscriptions","organizations_url":"https://api.github.com/users/GerardPaligot/orgs","repos_url":"https://api.github.com/users/GerardPaligot/repos","events_url":"https://api.github.com/users/GerardPaligot/events{/privacy}","received_events_url":"https://api.github.com/users/GerardPaligot/received_events","type":"User","site_admin":false},"body":"| Q                                   | R\r\n| ----------------------------------- | -------------------------------------------\r\n| Type de modification                | correction de bug\r\n| Ticket(s) (_issue(s)_) concerné(s)  | #2329\r\n\r\nEnfin ! Je suis parvenu à comprendre comment invalider le cache de l'API quand une insertion est faite dans les modèles couverts par l'API.\r\n\r\nJe vais tagguer cette PR en `P-Haute` parce que ça fait longtemps que ce bug traine et que l'API est inutilisable pour plusieurs projets.\r\n\r\n### QA\r\n\r\n- Configuez un système de cache sur votre environnement local.\r\n- Pour la liste des messages privés, des membres et des tags :\r\n  - Faite une première requête pour mettre en cache\r\n  - Faite une insertion (nouveau message, nouveau membre ou nouveau tag)\r\n  - Refaite la première requête et remarquez que la nouvelle donnée est dans la réponse.","created_at":"2016-07-29T22:25:04Z","updated_at":"2016-07-30T13:45:59Z","closed_at":null,"merged_at":null,"merge_commit_sha":"cbfa249fbb93044fa6b1c87834fdd2296547e1ac","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/zestedesavoir/zds-site/pulls/3755/commits","review_comments_url":"https://api.github.com/repos/zestedesavoir/zds-site/pulls/3755/comments","review_comment_url":"https://api.github.com/repos/zestedesavoir/zds-site/pulls/comments{/number}","comments_url":"https://api.github.com/repos/zestedesavoir/zds-site/issues/3755/comments","statuses_url":"https://api.github.com/repos/zestedesavoir/zds-site/statuses/2cd1692882b99407682f2edd3f5be6f5acf4fca1","head":{"label":"GerardPaligot:fix_cache_api","ref":"fix_cache_api","sha":"2cd1692882b99407682f2edd3f5be6f5acf4fca1","user":{"login":"GerardPaligot","id":1913901,"avatar_url":"https://avatars.githubusercontent.com/u/1913901?v=3","gravatar_id":"","url":"https://api.github.com/users/GerardPaligot","html_url":"https://github.com/GerardPaligot","followers_url":"https://api.github.com/users/GerardPaligot/followers","following_url":"https://api.github.com/users/GerardPaligot/following{/other_user}","gists_url":"https://api.github.com/users/GerardPaligot/gists{/gist_id}","starred_url":"https://api.github.com/users/GerardPaligot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GerardPaligot/subscriptions","organizations_url":"https://api.github.com/users/GerardPaligot/orgs","repos_url":"https://api.github.com/users/GerardPaligot/repos","events_url":"https://api.github.com/users/GerardPaligot/events{/privacy}","received_events_url":"https://api.github.com/users/GerardPaligot/received_events","type":"User","site_admin":false},"repo":{"id":20162464,"name":"zds-site","full_name":"GerardPaligot/zds-site","owner":{"login":"GerardPaligot","id":1913901,"avatar_url":"https://avatars.githubusercontent.com/u/1913901?v=3","gravatar_id":"","url":"https://api.github.com/users/GerardPaligot","html_url":"https://github.com/GerardPaligot","followers_url":"https://api.github.com/users/GerardPaligot/followers","following_url":"https://api.github.com/users/GerardPaligot/following{/other_user}","gists_url":"https://api.github.com/users/GerardPaligot/gists{/gist_id}","starred_url":"https://api.github.com/users/GerardPaligot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GerardPaligot/subscriptions","organizations_url":"https://api.github.com/users/GerardPaligot/orgs","repos_url":"https://api.github.com/users/GerardPaligot/repos","events_url":"https://api.github.com/users/GerardPaligot/events{/privacy}","received_events_url":"https://api.github.com/users/GerardPaligot/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/GerardPaligot/zds-site","description":"Dépot ZDS","fork":true,"url":"https://api.github.com/repos/GerardPaligot/zds-site","forks_url":"https://api.github.com/repos/GerardPaligot/zds-site/forks","keys_url":"https://api.github.com/repos/GerardPaligot/zds-site/keys{/key_id}","collaborators_url":"https://api.github.com/repos/GerardPaligot/zds-site/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/GerardPaligot/zds-site/teams","hooks_url":"https://api.github.com/repos/GerardPaligot/zds-site/hooks","issue_events_url":"https://api.github.com/repos/GerardPaligot/zds-site/issues/events{/number}","events_url":"https://api.github.com/repos/GerardPaligot/zds-site/events","assignees_url":"https://api.github.com/repos/GerardPaligot/zds-site/assignees{/user}","branches_url":"https://api.github.com/repos/GerardPaligot/zds-site/branches{/branch}","tags_url":"https://api.github.com/repos/GerardPaligot/zds-site/tags","blobs_url":"https://api.github.com/repos/GerardPaligot/zds-site/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/GerardPaligot/zds-site/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/GerardPaligot/zds-site/git/refs{/sha}","trees_url":"https://api.github.com/repos/GerardPaligot/zds-site/git/trees{/sha}","statuses_url":"https://api.github.com/repos/GerardPaligot/zds-site/statuses/{sha}","languages_url":"https://api.github.com/repos/GerardPaligot/zds-site/languages","stargazers_url":"https://api.github.com/repos/GerardPaligot/zds-site/stargazers","contributors_url":"https://api.github.com/repos/GerardPaligot/zds-site/contributors","subscribers_url":"https://api.github.com/repos/GerardPaligot/zds-site/subscribers","subscription_url":"https://api.github.com/repos/GerardPaligot/zds-site/subscription","commits_url":"https://api.github.com/repos/GerardPaligot/zds-site/commits{/sha}","git_commits_url":"https://api.github.com/repos/GerardPaligot/zds-site/git/commits{/sha}","comments_url":"https://api.github.com/repos/GerardPaligot/zds-site/comments{/number}","issue_comment_url":"https://api.github.com/repos/GerardPaligot/zds-site/issues/comments{/number}","contents_url":"https://api.github.com/repos/GerardPaligot/zds-site/contents/{+path}","compare_url":"https://api.github.com/repos/GerardPaligot/zds-site/compare/{base}...{head}","merges_url":"https://api.github.com/repos/GerardPaligot/zds-site/merges","archive_url":"https://api.github.com/repos/GerardPaligot/zds-site/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/GerardPaligot/zds-site/downloads","issues_url":"https://api.github.com/repos/GerardPaligot/zds-site/issues{/number}","pulls_url":"https://api.github.com/repos/GerardPaligot/zds-site/pulls{/number}","milestones_url":"https://api.github.com/repos/GerardPaligot/zds-site/milestones{/number}","notifications_url":"https://api.github.com/repos/GerardPaligot/zds-site/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/GerardPaligot/zds-site/labels{/name}","releases_url":"https://api.github.com/repos/GerardPaligot/zds-site/releases{/id}","deployments_url":"https://api.github.com/repos/GerardPaligot/zds-site/deployments","created_at":"2014-05-25T18:43:41Z","updated_at":"2016-05-05T20:25:56Z","pushed_at":"2016-07-29T22:16:42Z","git_url":"git://github.com/GerardPaligot/zds-site.git","ssh_url":"git@github.com:GerardPaligot/zds-site.git","clone_url":"https://github.com/GerardPaligot/zds-site.git","svn_url":"https://github.com/GerardPaligot/zds-site","homepage":null,"size":88490,"stargazers_count":1,"watchers_count":1,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":2,"forks":0,"open_issues":2,"watchers":1,"default_branch":"zep_24_signal"}},"base":{"label":"zestedesavoir:dev","ref":"dev","sha":"7178e1e8c8b62fc3690bc5caa2b4193e27dc1992","user":{"login":"zestedesavoir","id":7406239,"avatar_url":"https://avatars.githubusercontent.com/u/7406239?v=3","gravatar_id":"","url":"https://api.github.com/users/zestedesavoir","html_url":"https://github.com/zestedesavoir","followers_url":"https://api.github.com/users/zestedesavoir/followers","following_url":"https://api.github.com/users/zestedesavoir/following{/other_user}","gists_url":"https://api.github.com/users/zestedesavoir/gists{/gist_id}","starred_url":"https://api.github.com/users/zestedesavoir/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zestedesavoir/subscriptions","organizations_url":"https://api.github.com/users/zestedesavoir/orgs","repos_url":"https://api.github.com/users/zestedesavoir/repos","events_url":"https://api.github.com/users/zestedesavoir/events{/privacy}","received_events_url":"https://api.github.com/users/zestedesavoir/received_events","type":"Organization","site_admin":false},"repo":{"id":14778920,"name":"zds-site","full_name":"zestedesavoir/zds-site","owner":{"login":"zestedesavoir","id":7406239,"avatar_url":"https://avatars.githubusercontent.com/u/7406239?v=3","gravatar_id":"","url":"https://api.github.com/users/zestedesavoir","html_url":"https://github.com/zestedesavoir","followers_url":"https://api.github.com/users/zestedesavoir/followers","following_url":"https://api.github.com/users/zestedesavoir/following{/other_user}","gists_url":"https://api.github.com/users/zestedesavoir/gists{/gist_id}","starred_url":"https://api.github.com/users/zestedesavoir/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zestedesavoir/subscriptions","organizations_url":"https://api.github.com/users/zestedesavoir/orgs","repos_url":"https://api.github.com/users/zestedesavoir/repos","events_url":"https://api.github.com/users/zestedesavoir/events{/privacy}","received_events_url":"https://api.github.com/users/zestedesavoir/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/zestedesavoir/zds-site","description":"Dépot ZDS","fork":false,"url":"https://api.github.com/repos/zestedesavoir/zds-site","forks_url":"https://api.github.com/repos/zestedesavoir/zds-site/forks","keys_url":"https://api.github.com/repos/zestedesavoir/zds-site/keys{/key_id}","collaborators_url":"https://api.github.com/repos/zestedesavoir/zds-site/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/zestedesavoir/zds-site/teams","hooks_url":"https://api.github.com/repos/zestedesavoir/zds-site/hooks","issue_events_url":"https://api.github.com/repos/zestedesavoir/zds-site/issues/events{/number}","events_url":"https://api.github.com/repos/zestedesavoir/zds-site/events","assignees_url":"https://api.github.com/repos/zestedesavoir/zds-site/assignees{/user}","branches_url":"https://api.github.com/repos/zestedesavoir/zds-site/branches{/branch}","tags_url":"https://api.github.com/repos/zestedesavoir/zds-site/tags","blobs_url":"https://api.github.com/repos/zestedesavoir/zds-site/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/zestedesavoir/zds-site/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/zestedesavoir/zds-site/git/refs{/sha}","trees_url":"https://api.github.com/repos/zestedesavoir/zds-site/git/trees{/sha}","statuses_url":"https://api.github.com/repos/zestedesavoir/zds-site/statuses/{sha}","languages_url":"https://api.github.com/repos/zestedesavoir/zds-site/languages","stargazers_url":"https://api.github.com/repos/zestedesavoir/zds-site/stargazers","contributors_url":"https://api.github.com/repos/zestedesavoir/zds-site/contributors","subscribers_url":"https://api.github.com/repos/zestedesavoir/zds-site/subscribers","subscription_url":"https://api.github.com/repos/zestedesavoir/zds-site/subscription","commits_url":"https://api.github.com/repos/zestedesavoir/zds-site/commits{/sha}","git_commits_url":"https://api.github.com/repos/zestedesavoir/zds-site/git/commits{/sha}","comments_url":"https://api.github.com/repos/zestedesavoir/zds-site/comments{/number}","issue_comment_url":"https://api.github.com/repos/zestedesavoir/zds-site/issues/comments{/number}","contents_url":"https://api.github.com/repos/zestedesavoir/zds-site/contents/{+path}","compare_url":"https://api.github.com/repos/zestedesavoir/zds-site/compare/{base}...{head}","merges_url":"https://api.github.com/repos/zestedesavoir/zds-site/merges","archive_url":"https://api.github.com/repos/zestedesavoir/zds-site/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/zestedesavoir/zds-site/downloads","issues_url":"https://api.github.com/repos/zestedesavoir/zds-site/issues{/number}","pulls_url":"https://api.github.com/repos/zestedesavoir/zds-site/pulls{/number}","milestones_url":"https://api.github.com/repos/zestedesavoir/zds-site/milestones{/number}","notifications_url":"https://api.github.com/repos/zestedesavoir/zds-site/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/zestedesavoir/zds-site/labels{/name}","releases_url":"https://api.github.com/repos/zestedesavoir/zds-site/releases{/id}","deployments_url":"https://api.github.com/repos/zestedesavoir/zds-site/deployments","created_at":"2013-11-28T14:23:48Z","updated_at":"2016-07-24T10:26:00Z","pushed_at":"2016-07-29T22:25:04Z","git_url":"git://github.com/zestedesavoir/zds-site.git","ssh_url":"git@github.com:zestedesavoir/zds-site.git","clone_url":"https://github.com/zestedesavoir/zds-site.git","svn_url":"https://github.com/zestedesavoir/zds-site","homepage":null,"size":163128,"stargazers_count":157,"watchers_count":157,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":127,"mirror_url":null,"open_issues_count":226,"forks":127,"open_issues":226,"watchers":157,"default_branch":"dev"}},"_links":{"self":{"href":"https://api.github.com/repos/zestedesavoir/zds-site/pulls/3755"},"html":{"href":"https://github.com/zestedesavoir/zds-site/pull/3755"},"issue":{"href":"https://api.github.com/repos/zestedesavoir/zds-site/issues/3755"},"comments":{"href":"https://api.github.com/repos/zestedesavoir/zds-site/issues/3755/comments"},"review_comments":{"href":"https://api.github.com/repos/zestedesavoir/zds-site/pulls/3755/comments"},"review_comment":{"href":"https://api.github.com/repos/zestedesavoir/zds-site/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/zestedesavoir/zds-site/pulls/3755/commits"},"statuses":{"href":"https://api.github.com/repos/zestedesavoir/zds-site/statuses/2cd1692882b99407682f2edd3f5be6f5acf4fca1"}}}}
{"actor":{"display_login":"GerardPaligot"}}