{"action":"created","issue":{"url":"https://api.github.com/repos/divio/django-cms/issues/4143","labels_url":"https://api.github.com/repos/divio/django-cms/issues/4143/labels{/name}","comments_url":"https://api.github.com/repos/divio/django-cms/issues/4143/comments","events_url":"https://api.github.com/repos/divio/django-cms/issues/4143/events","html_url":"https://github.com/divio/django-cms/issues/4143","id":84165208,"number":4143,"title":"copy_relations() does not work for relations between cmsplugins","user":{"login":"philippze","id":1060363,"avatar_url":"https://avatars.githubusercontent.com/u/1060363?v=3","gravatar_id":"","url":"https://api.github.com/users/philippze","html_url":"https://github.com/philippze","followers_url":"https://api.github.com/users/philippze/followers","following_url":"https://api.github.com/users/philippze/following{/other_user}","gists_url":"https://api.github.com/users/philippze/gists{/gist_id}","starred_url":"https://api.github.com/users/philippze/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/philippze/subscriptions","organizations_url":"https://api.github.com/users/philippze/orgs","repos_url":"https://api.github.com/users/philippze/repos","events_url":"https://api.github.com/users/philippze/events{/privacy}","received_events_url":"https://api.github.com/users/philippze/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/divio/django-cms/labels/kind:%20bug","name":"kind: bug","color":"c7def8"},{"url":"https://api.github.com/repos/divio/django-cms/labels/needs%20patch","name":"needs patch","color":"f7c6c7"},{"url":"https://api.github.com/repos/divio/django-cms/labels/status:%20accepted","name":"status: accepted","color":"0052cc"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/divio/django-cms/milestones/38","html_url":"https://github.com/divio/django-cms/milestones/3.1.4","labels_url":"https://api.github.com/repos/divio/django-cms/milestones/38/labels","id":1285990,"number":38,"title":"3.1.4","description":"","creator":{"login":"yakky","id":714711,"avatar_url":"https://avatars.githubusercontent.com/u/714711?v=3","gravatar_id":"","url":"https://api.github.com/users/yakky","html_url":"https://github.com/yakky","followers_url":"https://api.github.com/users/yakky/followers","following_url":"https://api.github.com/users/yakky/following{/other_user}","gists_url":"https://api.github.com/users/yakky/gists{/gist_id}","starred_url":"https://api.github.com/users/yakky/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yakky/subscriptions","organizations_url":"https://api.github.com/users/yakky/orgs","repos_url":"https://api.github.com/users/yakky/repos","events_url":"https://api.github.com/users/yakky/events{/privacy}","received_events_url":"https://api.github.com/users/yakky/received_events","type":"User","site_admin":false},"open_issues":16,"closed_issues":15,"state":"open","created_at":"2015-09-02T10:44:00Z","updated_at":"2015-11-01T09:12:28Z","due_on":null,"closed_at":null},"comments":4,"created_at":"2015-06-02T19:17:24Z","updated_at":"2015-11-08T16:22:52Z","closed_at":null,"body":"In the docs, there's a recipe for [handling relations](http://docs.django-cms.org/en/develop/how_to/custom_plugins.html#handling-relations) in custom plugins.\r\n\r\nHowever, this will not work when we deal with relations from one cmsplugin to another cmsplugin.\r\n\r\nI've written four unittests [here](https://github.com/philippze/django-cms/commit/658e67f41f9029443ed3fe36d268ef09ef5e2644). Two pass and show that the docs is correct in usual cases. Two fail and show that it's not so simple for relations between cmsplugins.\r\n\r\nMaybe one could mention this in the docs.\r\n\r\nI'm now writing a little module that solves the problem for ManyToManyFields. Existing solutions welcome!"},"comment":{"url":"https://api.github.com/repos/divio/django-cms/issues/comments/154838252","html_url":"https://github.com/divio/django-cms/issues/4143#issuecomment-154838252","issue_url":"https://api.github.com/repos/divio/django-cms/issues/4143","id":154838252,"user":{"login":"sergei-maertens","id":5518550,"avatar_url":"https://avatars.githubusercontent.com/u/5518550?v=3","gravatar_id":"","url":"https://api.github.com/users/sergei-maertens","html_url":"https://github.com/sergei-maertens","followers_url":"https://api.github.com/users/sergei-maertens/followers","following_url":"https://api.github.com/users/sergei-maertens/following{/other_user}","gists_url":"https://api.github.com/users/sergei-maertens/gists{/gist_id}","starred_url":"https://api.github.com/users/sergei-maertens/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sergei-maertens/subscriptions","organizations_url":"https://api.github.com/users/sergei-maertens/orgs","repos_url":"https://api.github.com/users/sergei-maertens/repos","events_url":"https://api.github.com/users/sergei-maertens/events{/privacy}","received_events_url":"https://api.github.com/users/sergei-maertens/received_events","type":"User","site_admin":false},"created_at":"2015-11-08T16:22:52Z","updated_at":"2015-11-08T16:22:52Z","body":"Another use this case that fits this issue is re-using plugin content.\r\n\r\nWe have a specific use case where the end-user adds a 'Story' plugin to a certain page. It has some images, a bit of text, and nested plugins for the body of the content.\r\n\r\nOn the homepage, they need to be able to refer to this very same story, and if the initial story page (and plugin) gets updated, the homepage version has to be synced as well.\r\n\r\nCurrently this is solved by letting the `HomepageStoryPlugin` link (via FK) to the draft version of the `StoryPlugin`, but that obviously has its drawbacks."}}