{"action":"created","comment":{"url":"https://api.github.com/repos/ideascube/ideascube/pulls/comments/70527523","id":70527523,"diff_hunk":"@@ -0,0 +1,30 @@\n+class DatabaseRouter(object):\n+    \"\"\"\n+    A Database router.\n+    Some models do not need (and must not be backuped).\n+    Those models will (must) have a _dbname class attribute set to 'transiant'.\n+    This attribute will be use as database name.\n+    \"\"\"\n+    def db_for_read(self, model, **hints):\n+        \"\"\"\n+        If the model as a _dbname set, use it as db for read\n+        \"\"\"\n+        return getattr(model, '_dbname', None)\n+\n+    def db_for_write(self, model, **hints):\n+        \"\"\"\n+        If the model as a _dbname set, use it as db for read\n+        \"\"\"\n+        return getattr(model, '_dbname', None)\n+\n+    def allow_relation(self, obj1, obj2, **hints):\n+        \"\"\"\n+        Allow relations if both object are in the same database.\n+        \"\"\"\n+        return getattr(obj1, '_dbname', None) == getattr(obj2, '_dbname', None)\n+\n+    def allow_migrate(self, db, app_label, model_name=None, **hints):\n+        \"\"\"\n+        All database need to be migrated.\n+        \"\"\"\n+        return True","path":"db_router.py","position":30,"original_position":30,"commit_id":"9272064071fa228540d3741fda0c6b12c7fc0058","original_commit_id":"9272064071fa228540d3741fda0c6b12c7fc0058","user":{"login":"bochecha","id":272170,"avatar_url":"https://avatars.githubusercontent.com/u/272170?v=3","gravatar_id":"","url":"https://api.github.com/users/bochecha","html_url":"https://github.com/bochecha","followers_url":"https://api.github.com/users/bochecha/followers","following_url":"https://api.github.com/users/bochecha/following{/other_user}","gists_url":"https://api.github.com/users/bochecha/gists{/gist_id}","starred_url":"https://api.github.com/users/bochecha/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bochecha/subscriptions","organizations_url":"https://api.github.com/users/bochecha/orgs","repos_url":"https://api.github.com/users/bochecha/repos","events_url":"https://api.github.com/users/bochecha/events{/privacy}","received_events_url":"https://api.github.com/users/bochecha/received_events","type":"User","site_admin":false},"body":"As discussed in the other PR, I strongly think we should return `None` here, to let Django decide with its own rules whether the migration should be applied or not.\r\n\r\nI don't think our database router should be in the business of forcing (or forbidding) migrations, its job is to decide which database to connect to depending on the model.","created_at":"2016-07-12T21:38:58Z","updated_at":"2016-07-12T21:38:58Z","html_url":"https://github.com/ideascube/ideascube/pull/391#discussion_r70527523","pull_request_url":"https://api.github.com/repos/ideascube/ideascube/pulls/391","_links":{"self":{"href":"https://api.github.com/repos/ideascube/ideascube/pulls/comments/70527523"},"html":{"href":"https://github.com/ideascube/ideascube/pull/391#discussion_r70527523"},"pull_request":{"href":"https://api.github.com/repos/ideascube/ideascube/pulls/391"}}},"pull_request":{"url":"https://api.github.com/repos/ideascube/ideascube/pulls/391","id":77194589,"html_url":"https://github.com/ideascube/ideascube/pull/391","diff_url":"https://github.com/ideascube/ideascube/pull/391.diff","patch_url":"https://github.com/ideascube/ideascube/pull/391.patch","issue_url":"https://api.github.com/repos/ideascube/ideascube/issues/391","number":391,"state":"open","locked":false,"title":"Packaged content for the media center","user":{"login":"bochecha","id":272170,"avatar_url":"https://avatars.githubusercontent.com/u/272170?v=3","gravatar_id":"","url":"https://api.github.com/users/bochecha","html_url":"https://github.com/bochecha","followers_url":"https://api.github.com/users/bochecha/followers","following_url":"https://api.github.com/users/bochecha/following{/other_user}","gists_url":"https://api.github.com/users/bochecha/gists{/gist_id}","starred_url":"https://api.github.com/users/bochecha/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bochecha/subscriptions","organizations_url":"https://api.github.com/users/bochecha/orgs","repos_url":"https://api.github.com/users/bochecha/repos","events_url":"https://api.github.com/users/bochecha/events{/privacy}","received_events_url":"https://api.github.com/users/bochecha/received_events","type":"User","site_admin":false},"body":"This is part of #342 ","created_at":"2016-07-12T21:26:32Z","updated_at":"2016-07-12T21:38:58Z","closed_at":null,"merged_at":null,"merge_commit_sha":"83b20406fea7c670f422ca1c7efba629a1e4a5a4","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/ideascube/ideascube/pulls/391/commits","review_comments_url":"https://api.github.com/repos/ideascube/ideascube/pulls/391/comments","review_comment_url":"https://api.github.com/repos/ideascube/ideascube/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ideascube/ideascube/issues/391/comments","statuses_url":"https://api.github.com/repos/ideascube/ideascube/statuses/9272064071fa228540d3741fda0c6b12c7fc0058","head":{"label":"ideascube:feature/media-center-packages","ref":"feature/media-center-packages","sha":"9272064071fa228540d3741fda0c6b12c7fc0058","user":{"login":"ideascube","id":9719862,"avatar_url":"https://avatars.githubusercontent.com/u/9719862?v=3","gravatar_id":"","url":"https://api.github.com/users/ideascube","html_url":"https://github.com/ideascube","followers_url":"https://api.github.com/users/ideascube/followers","following_url":"https://api.github.com/users/ideascube/following{/other_user}","gists_url":"https://api.github.com/users/ideascube/gists{/gist_id}","starred_url":"https://api.github.com/users/ideascube/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ideascube/subscriptions","organizations_url":"https://api.github.com/users/ideascube/orgs","repos_url":"https://api.github.com/users/ideascube/repos","events_url":"https://api.github.com/users/ideascube/events{/privacy}","received_events_url":"https://api.github.com/users/ideascube/received_events","type":"Organization","site_admin":false},"repo":{"id":26708471,"name":"ideascube","full_name":"ideascube/ideascube","owner":{"login":"ideascube","id":9719862,"avatar_url":"https://avatars.githubusercontent.com/u/9719862?v=3","gravatar_id":"","url":"https://api.github.com/users/ideascube","html_url":"https://github.com/ideascube","followers_url":"https://api.github.com/users/ideascube/followers","following_url":"https://api.github.com/users/ideascube/following{/other_user}","gists_url":"https://api.github.com/users/ideascube/gists{/gist_id}","starred_url":"https://api.github.com/users/ideascube/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ideascube/subscriptions","organizations_url":"https://api.github.com/users/ideascube/orgs","repos_url":"https://api.github.com/users/ideascube/repos","events_url":"https://api.github.com/users/ideascube/events{/privacy}","received_events_url":"https://api.github.com/users/ideascube/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ideascube/ideascube","description":"Ideas Box server core application","fork":false,"url":"https://api.github.com/repos/ideascube/ideascube","forks_url":"https://api.github.com/repos/ideascube/ideascube/forks","keys_url":"https://api.github.com/repos/ideascube/ideascube/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ideascube/ideascube/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ideascube/ideascube/teams","hooks_url":"https://api.github.com/repos/ideascube/ideascube/hooks","issue_events_url":"https://api.github.com/repos/ideascube/ideascube/issues/events{/number}","events_url":"https://api.github.com/repos/ideascube/ideascube/events","assignees_url":"https://api.github.com/repos/ideascube/ideascube/assignees{/user}","branches_url":"https://api.github.com/repos/ideascube/ideascube/branches{/branch}","tags_url":"https://api.github.com/repos/ideascube/ideascube/tags","blobs_url":"https://api.github.com/repos/ideascube/ideascube/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ideascube/ideascube/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ideascube/ideascube/git/refs{/sha}","trees_url":"https://api.github.com/repos/ideascube/ideascube/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ideascube/ideascube/statuses/{sha}","languages_url":"https://api.github.com/repos/ideascube/ideascube/languages","stargazers_url":"https://api.github.com/repos/ideascube/ideascube/stargazers","contributors_url":"https://api.github.com/repos/ideascube/ideascube/contributors","subscribers_url":"https://api.github.com/repos/ideascube/ideascube/subscribers","subscription_url":"https://api.github.com/repos/ideascube/ideascube/subscription","commits_url":"https://api.github.com/repos/ideascube/ideascube/commits{/sha}","git_commits_url":"https://api.github.com/repos/ideascube/ideascube/git/commits{/sha}","comments_url":"https://api.github.com/repos/ideascube/ideascube/comments{/number}","issue_comment_url":"https://api.github.com/repos/ideascube/ideascube/issues/comments{/number}","contents_url":"https://api.github.com/repos/ideascube/ideascube/contents/{+path}","compare_url":"https://api.github.com/repos/ideascube/ideascube/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ideascube/ideascube/merges","archive_url":"https://api.github.com/repos/ideascube/ideascube/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ideascube/ideascube/downloads","issues_url":"https://api.github.com/repos/ideascube/ideascube/issues{/number}","pulls_url":"https://api.github.com/repos/ideascube/ideascube/pulls{/number}","milestones_url":"https://api.github.com/repos/ideascube/ideascube/milestones{/number}","notifications_url":"https://api.github.com/repos/ideascube/ideascube/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ideascube/ideascube/labels{/name}","releases_url":"https://api.github.com/repos/ideascube/ideascube/releases{/id}","deployments_url":"https://api.github.com/repos/ideascube/ideascube/deployments","created_at":"2014-11-16T08:39:32Z","updated_at":"2016-07-02T11:31:49Z","pushed_at":"2016-07-12T21:32:50Z","git_url":"git://github.com/ideascube/ideascube.git","ssh_url":"git@github.com:ideascube/ideascube.git","clone_url":"https://github.com/ideascube/ideascube.git","svn_url":"https://github.com/ideascube/ideascube","homepage":"http://ideascube.readthedocs.org/","size":10313,"stargazers_count":20,"watchers_count":20,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":24,"mirror_url":null,"open_issues_count":130,"forks":24,"open_issues":130,"watchers":20,"default_branch":"master"}},"base":{"label":"ideascube:master","ref":"master","sha":"29820d17938d38889de03be249e47126c4483eba","user":{"login":"ideascube","id":9719862,"avatar_url":"https://avatars.githubusercontent.com/u/9719862?v=3","gravatar_id":"","url":"https://api.github.com/users/ideascube","html_url":"https://github.com/ideascube","followers_url":"https://api.github.com/users/ideascube/followers","following_url":"https://api.github.com/users/ideascube/following{/other_user}","gists_url":"https://api.github.com/users/ideascube/gists{/gist_id}","starred_url":"https://api.github.com/users/ideascube/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ideascube/subscriptions","organizations_url":"https://api.github.com/users/ideascube/orgs","repos_url":"https://api.github.com/users/ideascube/repos","events_url":"https://api.github.com/users/ideascube/events{/privacy}","received_events_url":"https://api.github.com/users/ideascube/received_events","type":"Organization","site_admin":false},"repo":{"id":26708471,"name":"ideascube","full_name":"ideascube/ideascube","owner":{"login":"ideascube","id":9719862,"avatar_url":"https://avatars.githubusercontent.com/u/9719862?v=3","gravatar_id":"","url":"https://api.github.com/users/ideascube","html_url":"https://github.com/ideascube","followers_url":"https://api.github.com/users/ideascube/followers","following_url":"https://api.github.com/users/ideascube/following{/other_user}","gists_url":"https://api.github.com/users/ideascube/gists{/gist_id}","starred_url":"https://api.github.com/users/ideascube/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ideascube/subscriptions","organizations_url":"https://api.github.com/users/ideascube/orgs","repos_url":"https://api.github.com/users/ideascube/repos","events_url":"https://api.github.com/users/ideascube/events{/privacy}","received_events_url":"https://api.github.com/users/ideascube/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ideascube/ideascube","description":"Ideas Box server core application","fork":false,"url":"https://api.github.com/repos/ideascube/ideascube","forks_url":"https://api.github.com/repos/ideascube/ideascube/forks","keys_url":"https://api.github.com/repos/ideascube/ideascube/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ideascube/ideascube/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ideascube/ideascube/teams","hooks_url":"https://api.github.com/repos/ideascube/ideascube/hooks","issue_events_url":"https://api.github.com/repos/ideascube/ideascube/issues/events{/number}","events_url":"https://api.github.com/repos/ideascube/ideascube/events","assignees_url":"https://api.github.com/repos/ideascube/ideascube/assignees{/user}","branches_url":"https://api.github.com/repos/ideascube/ideascube/branches{/branch}","tags_url":"https://api.github.com/repos/ideascube/ideascube/tags","blobs_url":"https://api.github.com/repos/ideascube/ideascube/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ideascube/ideascube/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ideascube/ideascube/git/refs{/sha}","trees_url":"https://api.github.com/repos/ideascube/ideascube/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ideascube/ideascube/statuses/{sha}","languages_url":"https://api.github.com/repos/ideascube/ideascube/languages","stargazers_url":"https://api.github.com/repos/ideascube/ideascube/stargazers","contributors_url":"https://api.github.com/repos/ideascube/ideascube/contributors","subscribers_url":"https://api.github.com/repos/ideascube/ideascube/subscribers","subscription_url":"https://api.github.com/repos/ideascube/ideascube/subscription","commits_url":"https://api.github.com/repos/ideascube/ideascube/commits{/sha}","git_commits_url":"https://api.github.com/repos/ideascube/ideascube/git/commits{/sha}","comments_url":"https://api.github.com/repos/ideascube/ideascube/comments{/number}","issue_comment_url":"https://api.github.com/repos/ideascube/ideascube/issues/comments{/number}","contents_url":"https://api.github.com/repos/ideascube/ideascube/contents/{+path}","compare_url":"https://api.github.com/repos/ideascube/ideascube/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ideascube/ideascube/merges","archive_url":"https://api.github.com/repos/ideascube/ideascube/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ideascube/ideascube/downloads","issues_url":"https://api.github.com/repos/ideascube/ideascube/issues{/number}","pulls_url":"https://api.github.com/repos/ideascube/ideascube/pulls{/number}","milestones_url":"https://api.github.com/repos/ideascube/ideascube/milestones{/number}","notifications_url":"https://api.github.com/repos/ideascube/ideascube/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ideascube/ideascube/labels{/name}","releases_url":"https://api.github.com/repos/ideascube/ideascube/releases{/id}","deployments_url":"https://api.github.com/repos/ideascube/ideascube/deployments","created_at":"2014-11-16T08:39:32Z","updated_at":"2016-07-02T11:31:49Z","pushed_at":"2016-07-12T21:32:50Z","git_url":"git://github.com/ideascube/ideascube.git","ssh_url":"git@github.com:ideascube/ideascube.git","clone_url":"https://github.com/ideascube/ideascube.git","svn_url":"https://github.com/ideascube/ideascube","homepage":"http://ideascube.readthedocs.org/","size":10313,"stargazers_count":20,"watchers_count":20,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":24,"mirror_url":null,"open_issues_count":130,"forks":24,"open_issues":130,"watchers":20,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ideascube/ideascube/pulls/391"},"html":{"href":"https://github.com/ideascube/ideascube/pull/391"},"issue":{"href":"https://api.github.com/repos/ideascube/ideascube/issues/391"},"comments":{"href":"https://api.github.com/repos/ideascube/ideascube/issues/391/comments"},"review_comments":{"href":"https://api.github.com/repos/ideascube/ideascube/pulls/391/comments"},"review_comment":{"href":"https://api.github.com/repos/ideascube/ideascube/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ideascube/ideascube/pulls/391/commits"},"statuses":{"href":"https://api.github.com/repos/ideascube/ideascube/statuses/9272064071fa228540d3741fda0c6b12c7fc0058"}}}}
{"actor":{"display_login":"bochecha"}}