{"action":"created","issue":{"url":"https://api.github.com/repos/matthiask/django-content-editor/issues/2","repository_url":"https://api.github.com/repos/matthiask/django-content-editor","labels_url":"https://api.github.com/repos/matthiask/django-content-editor/issues/2/labels{/name}","comments_url":"https://api.github.com/repos/matthiask/django-content-editor/issues/2/comments","events_url":"https://api.github.com/repos/matthiask/django-content-editor/issues/2/events","html_url":"https://github.com/matthiask/django-content-editor/pull/2","id":175127234,"number":2,"title":"Add region restriction","user":{"login":"zakdoek","id":3807138,"avatar_url":"https://avatars.githubusercontent.com/u/3807138?v=3","gravatar_id":"","url":"https://api.github.com/users/zakdoek","html_url":"https://github.com/zakdoek","followers_url":"https://api.github.com/users/zakdoek/followers","following_url":"https://api.github.com/users/zakdoek/following{/other_user}","gists_url":"https://api.github.com/users/zakdoek/gists{/gist_id}","starred_url":"https://api.github.com/users/zakdoek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zakdoek/subscriptions","organizations_url":"https://api.github.com/users/zakdoek/orgs","repos_url":"https://api.github.com/users/zakdoek/repos","events_url":"https://api.github.com/users/zakdoek/events{/privacy}","received_events_url":"https://api.github.com/users/zakdoek/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2016-09-05T21:04:14Z","updated_at":"2016-09-06T07:29:52Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/matthiask/django-content-editor/pulls/2","html_url":"https://github.com/matthiask/django-content-editor/pull/2","diff_url":"https://github.com/matthiask/django-content-editor/pull/2.diff","patch_url":"https://github.com/matthiask/django-content-editor/pull/2.patch"},"body":"Allow for plugin restriction per region.\r\n\r\n```\r\nclass MyPlugin(PluginBase):\r\n    class Meta:\r\n        regions = (\"region_1_key\", \"region_2_key\")\r\n```\r\n\r\nWhen the region field is not set, a plugin can be added to all regions."},"comment":{"url":"https://api.github.com/repos/matthiask/django-content-editor/issues/comments/244871284","html_url":"https://github.com/matthiask/django-content-editor/pull/2#issuecomment-244871284","issue_url":"https://api.github.com/repos/matthiask/django-content-editor/issues/2","id":244871284,"user":{"login":"matthiask","id":2627,"avatar_url":"https://avatars.githubusercontent.com/u/2627?v=3","gravatar_id":"","url":"https://api.github.com/users/matthiask","html_url":"https://github.com/matthiask","followers_url":"https://api.github.com/users/matthiask/followers","following_url":"https://api.github.com/users/matthiask/following{/other_user}","gists_url":"https://api.github.com/users/matthiask/gists{/gist_id}","starred_url":"https://api.github.com/users/matthiask/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/matthiask/subscriptions","organizations_url":"https://api.github.com/users/matthiask/orgs","repos_url":"https://api.github.com/users/matthiask/repos","events_url":"https://api.github.com/users/matthiask/events{/privacy}","received_events_url":"https://api.github.com/users/matthiask/received_events","type":"User","site_admin":false},"created_at":"2016-09-06T07:29:52Z","updated_at":"2016-09-06T07:29:52Z","body":"Well, restricting plugins to regions was available in FeinCMS as well, so I'll happily merge these changes! The implementation in FeinCMS was not complete though — it allowed adding plugins, and moving them into regions where they shouldn't be, therefore my question regarding server side validation. \r\n\r\nIf `regions` is a model-level attribute it should be validated. I like your proposal of moving `regions` to the `ContentEditorInline` it's more of a presentation thing then, and if someone really wants to circumvent this then more power to them."}}
{"actor":{"display_login":"matthiask"}}