{"action":"created","comment":{"url":"https://api.github.com/repos/incuna/django-orderable/pulls/comments/23187123","id":23187123,"diff_hunk":"@@ -1,5 +1,15 @@\n+from django.db import models\n+\n from ..models import Orderable\n \n \n class Task(Orderable):\n     \"\"\"A basic orderable model for tests.\"\"\"\n+\n+\n+class SubTask(Orderable):\n+    \"\"\"An orderable model with unique_together.\"\"\"\n+    task = models.ForeignKey('Task')\n+\n+    class Meta:\n+        unique_together = ('task', 'sort_order')","path":"orderable/tests/models.py","position":15,"original_position":15,"commit_id":"c1a909d19ffd234409db9a6771709b721b76717b","original_commit_id":"c1a909d19ffd234409db9a6771709b721b76717b","user":{"login":"meshy","id":767671,"avatar_url":"https://avatars.githubusercontent.com/u/767671?v=3","gravatar_id":"","url":"https://api.github.com/users/meshy","html_url":"https://github.com/meshy","followers_url":"https://api.github.com/users/meshy/followers","following_url":"https://api.github.com/users/meshy/following{/other_user}","gists_url":"https://api.github.com/users/meshy/gists{/gist_id}","starred_url":"https://api.github.com/users/meshy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/meshy/subscriptions","organizations_url":"https://api.github.com/users/meshy/orgs","repos_url":"https://api.github.com/users/meshy/repos","events_url":"https://api.github.com/users/meshy/events{/privacy}","received_events_url":"https://api.github.com/users/meshy/received_events","type":"User","site_admin":false},"body":"I wonder if #7 will come into play here?","created_at":"2015-01-19T21:11:09Z","updated_at":"2015-01-19T21:11:09Z","html_url":"https://github.com/incuna/django-orderable/pull/26#discussion_r23187123","pull_request_url":"https://api.github.com/repos/incuna/django-orderable/pulls/26","_links":{"self":{"href":"https://api.github.com/repos/incuna/django-orderable/pulls/comments/23187123"},"html":{"href":"https://github.com/incuna/django-orderable/pull/26#discussion_r23187123"},"pull_request":{"href":"https://api.github.com/repos/incuna/django-orderable/pulls/26"}}},"pull_request":{"url":"https://api.github.com/repos/incuna/django-orderable/pulls/26","id":27633270,"html_url":"https://github.com/incuna/django-orderable/pull/26","diff_url":"https://github.com/incuna/django-orderable/pull/26.diff","patch_url":"https://github.com/incuna/django-orderable/pull/26.patch","issue_url":"https://api.github.com/repos/incuna/django-orderable/issues/26","number":26,"state":"open","locked":false,"title":"Multiple reordering with uniqueness condition can result in integrity errors","user":{"login":"mjtamlyn","id":389581,"avatar_url":"https://avatars.githubusercontent.com/u/389581?v=3","gravatar_id":"","url":"https://api.github.com/users/mjtamlyn","html_url":"https://github.com/mjtamlyn","followers_url":"https://api.github.com/users/mjtamlyn/followers","following_url":"https://api.github.com/users/mjtamlyn/following{/other_user}","gists_url":"https://api.github.com/users/mjtamlyn/gists{/gist_id}","starred_url":"https://api.github.com/users/mjtamlyn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mjtamlyn/subscriptions","organizations_url":"https://api.github.com/users/mjtamlyn/orgs","repos_url":"https://api.github.com/users/mjtamlyn/repos","events_url":"https://api.github.com/users/mjtamlyn/events{/privacy}","received_events_url":"https://api.github.com/users/mjtamlyn/received_events","type":"User","site_admin":false},"body":"The old/new position tracking falls over if multiple objects are updated in the same request - which can happen from the admin reorder views. As a result, transaction management is needed to try again if the value is incorrect. As a result of wanting to use `atomic()`, I've removed 1.4 support. 1.4 is near EOL now and 1.8 (in alpha) will be the new LTS so I hope this is not too critical. Might warrant a big number version bump though.\r\n\r\nNote that in the process of restructuring the save method I have removed inline methods - these have debatable performance on CPython but are *totally* useless on pypy so Alex will kill me if I don't remove them ;)\r\n\r\nAs separate work, I've copied some code from django's `runtests.py` which allows you to use `orderable/tests/run.py` like `manage.py test` and pass some helpful options to it.","created_at":"2015-01-19T20:24:47Z","updated_at":"2015-01-19T21:11:09Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7efd76273aa527f900ff3e6b32bf85f251184765","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/incuna/django-orderable/pulls/26/commits","review_comments_url":"https://api.github.com/repos/incuna/django-orderable/pulls/26/comments","review_comment_url":"https://api.github.com/repos/incuna/django-orderable/pulls/comments/{number}","comments_url":"https://api.github.com/repos/incuna/django-orderable/issues/26/comments","statuses_url":"https://api.github.com/repos/incuna/django-orderable/statuses/c1a909d19ffd234409db9a6771709b721b76717b","head":{"label":"mjtamlyn:edge-cases","ref":"edge-cases","sha":"c1a909d19ffd234409db9a6771709b721b76717b","user":{"login":"mjtamlyn","id":389581,"avatar_url":"https://avatars.githubusercontent.com/u/389581?v=3","gravatar_id":"","url":"https://api.github.com/users/mjtamlyn","html_url":"https://github.com/mjtamlyn","followers_url":"https://api.github.com/users/mjtamlyn/followers","following_url":"https://api.github.com/users/mjtamlyn/following{/other_user}","gists_url":"https://api.github.com/users/mjtamlyn/gists{/gist_id}","starred_url":"https://api.github.com/users/mjtamlyn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mjtamlyn/subscriptions","organizations_url":"https://api.github.com/users/mjtamlyn/orgs","repos_url":"https://api.github.com/users/mjtamlyn/repos","events_url":"https://api.github.com/users/mjtamlyn/events{/privacy}","received_events_url":"https://api.github.com/users/mjtamlyn/received_events","type":"User","site_admin":false},"repo":{"id":29387423,"name":"django-orderable","full_name":"mjtamlyn/django-orderable","owner":{"login":"mjtamlyn","id":389581,"avatar_url":"https://avatars.githubusercontent.com/u/389581?v=3","gravatar_id":"","url":"https://api.github.com/users/mjtamlyn","html_url":"https://github.com/mjtamlyn","followers_url":"https://api.github.com/users/mjtamlyn/followers","following_url":"https://api.github.com/users/mjtamlyn/following{/other_user}","gists_url":"https://api.github.com/users/mjtamlyn/gists{/gist_id}","starred_url":"https://api.github.com/users/mjtamlyn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mjtamlyn/subscriptions","organizations_url":"https://api.github.com/users/mjtamlyn/orgs","repos_url":"https://api.github.com/users/mjtamlyn/repos","events_url":"https://api.github.com/users/mjtamlyn/events{/privacy}","received_events_url":"https://api.github.com/users/mjtamlyn/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mjtamlyn/django-orderable","description":"django-orderable","fork":true,"url":"https://api.github.com/repos/mjtamlyn/django-orderable","forks_url":"https://api.github.com/repos/mjtamlyn/django-orderable/forks","keys_url":"https://api.github.com/repos/mjtamlyn/django-orderable/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mjtamlyn/django-orderable/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mjtamlyn/django-orderable/teams","hooks_url":"https://api.github.com/repos/mjtamlyn/django-orderable/hooks","issue_events_url":"https://api.github.com/repos/mjtamlyn/django-orderable/issues/events{/number}","events_url":"https://api.github.com/repos/mjtamlyn/django-orderable/events","assignees_url":"https://api.github.com/repos/mjtamlyn/django-orderable/assignees{/user}","branches_url":"https://api.github.com/repos/mjtamlyn/django-orderable/branches{/branch}","tags_url":"https://api.github.com/repos/mjtamlyn/django-orderable/tags","blobs_url":"https://api.github.com/repos/mjtamlyn/django-orderable/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mjtamlyn/django-orderable/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mjtamlyn/django-orderable/git/refs{/sha}","trees_url":"https://api.github.com/repos/mjtamlyn/django-orderable/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mjtamlyn/django-orderable/statuses/{sha}","languages_url":"https://api.github.com/repos/mjtamlyn/django-orderable/languages","stargazers_url":"https://api.github.com/repos/mjtamlyn/django-orderable/stargazers","contributors_url":"https://api.github.com/repos/mjtamlyn/django-orderable/contributors","subscribers_url":"https://api.github.com/repos/mjtamlyn/django-orderable/subscribers","subscription_url":"https://api.github.com/repos/mjtamlyn/django-orderable/subscription","commits_url":"https://api.github.com/repos/mjtamlyn/django-orderable/commits{/sha}","git_commits_url":"https://api.github.com/repos/mjtamlyn/django-orderable/git/commits{/sha}","comments_url":"https://api.github.com/repos/mjtamlyn/django-orderable/comments{/number}","issue_comment_url":"https://api.github.com/repos/mjtamlyn/django-orderable/issues/comments/{number}","contents_url":"https://api.github.com/repos/mjtamlyn/django-orderable/contents/{+path}","compare_url":"https://api.github.com/repos/mjtamlyn/django-orderable/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mjtamlyn/django-orderable/merges","archive_url":"https://api.github.com/repos/mjtamlyn/django-orderable/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mjtamlyn/django-orderable/downloads","issues_url":"https://api.github.com/repos/mjtamlyn/django-orderable/issues{/number}","pulls_url":"https://api.github.com/repos/mjtamlyn/django-orderable/pulls{/number}","milestones_url":"https://api.github.com/repos/mjtamlyn/django-orderable/milestones{/number}","notifications_url":"https://api.github.com/repos/mjtamlyn/django-orderable/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mjtamlyn/django-orderable/labels{/name}","releases_url":"https://api.github.com/repos/mjtamlyn/django-orderable/releases{/id}","created_at":"2015-01-17T10:15:49Z","updated_at":"2015-01-17T10:15:49Z","pushed_at":"2015-01-19T20:36:29Z","git_url":"git://github.com/mjtamlyn/django-orderable.git","ssh_url":"git@github.com:mjtamlyn/django-orderable.git","clone_url":"https://github.com/mjtamlyn/django-orderable.git","svn_url":"https://github.com/mjtamlyn/django-orderable","homepage":null,"size":141,"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":"master"}},"base":{"label":"incuna:master","ref":"master","sha":"222567c52a1e05864efcf51cd5e856b0823082ee","user":{"login":"incuna","id":55510,"avatar_url":"https://avatars.githubusercontent.com/u/55510?v=3","gravatar_id":"","url":"https://api.github.com/users/incuna","html_url":"https://github.com/incuna","followers_url":"https://api.github.com/users/incuna/followers","following_url":"https://api.github.com/users/incuna/following{/other_user}","gists_url":"https://api.github.com/users/incuna/gists{/gist_id}","starred_url":"https://api.github.com/users/incuna/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/incuna/subscriptions","organizations_url":"https://api.github.com/users/incuna/orgs","repos_url":"https://api.github.com/users/incuna/repos","events_url":"https://api.github.com/users/incuna/events{/privacy}","received_events_url":"https://api.github.com/users/incuna/received_events","type":"Organization","site_admin":false},"repo":{"id":4192553,"name":"django-orderable","full_name":"incuna/django-orderable","owner":{"login":"incuna","id":55510,"avatar_url":"https://avatars.githubusercontent.com/u/55510?v=3","gravatar_id":"","url":"https://api.github.com/users/incuna","html_url":"https://github.com/incuna","followers_url":"https://api.github.com/users/incuna/followers","following_url":"https://api.github.com/users/incuna/following{/other_user}","gists_url":"https://api.github.com/users/incuna/gists{/gist_id}","starred_url":"https://api.github.com/users/incuna/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/incuna/subscriptions","organizations_url":"https://api.github.com/users/incuna/orgs","repos_url":"https://api.github.com/users/incuna/repos","events_url":"https://api.github.com/users/incuna/events{/privacy}","received_events_url":"https://api.github.com/users/incuna/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/incuna/django-orderable","description":"django-orderable","fork":false,"url":"https://api.github.com/repos/incuna/django-orderable","forks_url":"https://api.github.com/repos/incuna/django-orderable/forks","keys_url":"https://api.github.com/repos/incuna/django-orderable/keys{/key_id}","collaborators_url":"https://api.github.com/repos/incuna/django-orderable/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/incuna/django-orderable/teams","hooks_url":"https://api.github.com/repos/incuna/django-orderable/hooks","issue_events_url":"https://api.github.com/repos/incuna/django-orderable/issues/events{/number}","events_url":"https://api.github.com/repos/incuna/django-orderable/events","assignees_url":"https://api.github.com/repos/incuna/django-orderable/assignees{/user}","branches_url":"https://api.github.com/repos/incuna/django-orderable/branches{/branch}","tags_url":"https://api.github.com/repos/incuna/django-orderable/tags","blobs_url":"https://api.github.com/repos/incuna/django-orderable/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/incuna/django-orderable/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/incuna/django-orderable/git/refs{/sha}","trees_url":"https://api.github.com/repos/incuna/django-orderable/git/trees{/sha}","statuses_url":"https://api.github.com/repos/incuna/django-orderable/statuses/{sha}","languages_url":"https://api.github.com/repos/incuna/django-orderable/languages","stargazers_url":"https://api.github.com/repos/incuna/django-orderable/stargazers","contributors_url":"https://api.github.com/repos/incuna/django-orderable/contributors","subscribers_url":"https://api.github.com/repos/incuna/django-orderable/subscribers","subscription_url":"https://api.github.com/repos/incuna/django-orderable/subscription","commits_url":"https://api.github.com/repos/incuna/django-orderable/commits{/sha}","git_commits_url":"https://api.github.com/repos/incuna/django-orderable/git/commits{/sha}","comments_url":"https://api.github.com/repos/incuna/django-orderable/comments{/number}","issue_comment_url":"https://api.github.com/repos/incuna/django-orderable/issues/comments/{number}","contents_url":"https://api.github.com/repos/incuna/django-orderable/contents/{+path}","compare_url":"https://api.github.com/repos/incuna/django-orderable/compare/{base}...{head}","merges_url":"https://api.github.com/repos/incuna/django-orderable/merges","archive_url":"https://api.github.com/repos/incuna/django-orderable/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/incuna/django-orderable/downloads","issues_url":"https://api.github.com/repos/incuna/django-orderable/issues{/number}","pulls_url":"https://api.github.com/repos/incuna/django-orderable/pulls{/number}","milestones_url":"https://api.github.com/repos/incuna/django-orderable/milestones{/number}","notifications_url":"https://api.github.com/repos/incuna/django-orderable/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/incuna/django-orderable/labels{/name}","releases_url":"https://api.github.com/repos/incuna/django-orderable/releases{/id}","created_at":"2012-05-01T13:38:15Z","updated_at":"2015-01-19T19:18:08Z","pushed_at":"2015-01-19T10:20:08Z","git_url":"git://github.com/incuna/django-orderable.git","ssh_url":"git@github.com:incuna/django-orderable.git","clone_url":"https://github.com/incuna/django-orderable.git","svn_url":"https://github.com/incuna/django-orderable","homepage":null,"size":397,"stargazers_count":7,"watchers_count":7,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":10,"forks":3,"open_issues":10,"watchers":7,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/incuna/django-orderable/pulls/26"},"html":{"href":"https://github.com/incuna/django-orderable/pull/26"},"issue":{"href":"https://api.github.com/repos/incuna/django-orderable/issues/26"},"comments":{"href":"https://api.github.com/repos/incuna/django-orderable/issues/26/comments"},"review_comments":{"href":"https://api.github.com/repos/incuna/django-orderable/pulls/26/comments"},"review_comment":{"href":"https://api.github.com/repos/incuna/django-orderable/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/incuna/django-orderable/pulls/26/commits"},"statuses":{"href":"https://api.github.com/repos/incuna/django-orderable/statuses/c1a909d19ffd234409db9a6771709b721b76717b"}}}}