{"action":"closed","issue":{"url":"https://api.github.com/repos/meteozond/django-permanent/issues/11","labels_url":"https://api.github.com/repos/meteozond/django-permanent/issues/11/labels{/name}","comments_url":"https://api.github.com/repos/meteozond/django-permanent/issues/11/comments","events_url":"https://api.github.com/repos/meteozond/django-permanent/issues/11/events","html_url":"https://github.com/meteozond/django-permanent/issues/11","id":62373289,"number":11,"title":"m2m trough model support","user":{"login":"meteozond","id":975689,"avatar_url":"https://avatars.githubusercontent.com/u/975689?v=3","gravatar_id":"","url":"https://api.github.com/users/meteozond","html_url":"https://github.com/meteozond","followers_url":"https://api.github.com/users/meteozond/followers","following_url":"https://api.github.com/users/meteozond/following{/other_user}","gists_url":"https://api.github.com/users/meteozond/gists{/gist_id}","starred_url":"https://api.github.com/users/meteozond/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/meteozond/subscriptions","organizations_url":"https://api.github.com/users/meteozond/orgs","repos_url":"https://api.github.com/users/meteozond/repos","events_url":"https://api.github.com/users/meteozond/events{/privacy}","received_events_url":"https://api.github.com/users/meteozond/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/meteozond/django-permanent/milestones/3","html_url":"https://github.com/meteozond/django-permanent/milestones/1.0.4","labels_url":"https://api.github.com/repos/meteozond/django-permanent/milestones/3/labels","id":1025232,"number":3,"title":"1.0.4","description":"","creator":{"login":"meteozond","id":975689,"avatar_url":"https://avatars.githubusercontent.com/u/975689?v=3","gravatar_id":"","url":"https://api.github.com/users/meteozond","html_url":"https://github.com/meteozond","followers_url":"https://api.github.com/users/meteozond/followers","following_url":"https://api.github.com/users/meteozond/following{/other_user}","gists_url":"https://api.github.com/users/meteozond/gists{/gist_id}","starred_url":"https://api.github.com/users/meteozond/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/meteozond/subscriptions","organizations_url":"https://api.github.com/users/meteozond/orgs","repos_url":"https://api.github.com/users/meteozond/repos","events_url":"https://api.github.com/users/meteozond/events{/privacy}","received_events_url":"https://api.github.com/users/meteozond/received_events","type":"User","site_admin":false},"open_issues":0,"closed_issues":2,"state":"open","created_at":"2015-03-17T11:51:41Z","updated_at":"2015-03-18T10:44:37Z","due_on":null,"closed_at":null},"comments":0,"created_at":"2015-03-17T11:44:19Z","updated_at":"2015-03-18T10:44:37Z","closed_at":"2015-03-18T10:44:37Z","body":"Django ignores `through model manager` during `m2m field manger` query. Using `PermanentModel` as m2m `through` will return all objects including removed.\r\n\r\nHow to reproduce:\r\n\r\n    class M2MFrom(Model):\r\n        pass\r\n    \r\n    class PermanentM2MThrough(PermanentModel):\r\n        m2m_from = models.ForeignKey('M2MFrom')\r\n        m2m_to = models.ForeignKey('M2MTo')\r\n    \r\n    class M2MTo(Model):\r\n        m2m_from = models.ManyToManyField('M2MFrom', through=PermanentM2MThrough)\r\n        objects = M2MPermanentManager()\r\n\r\n    _from = M2MFrom.objects.create()\r\n    _to = M2MTo.objects.create()\r\n    through = PermanentM2MThrough.objects.create(m2m_from=_from, m2m_to=_to)\r\n    through.delete()\r\n    assert _from.m2mto_set.count() == 1\r\n"}}