{"action":"created","issue":{"url":"https://api.github.com/repos/OpenSlides/OpenSlides/issues/2278","repository_url":"https://api.github.com/repos/OpenSlides/OpenSlides","labels_url":"https://api.github.com/repos/OpenSlides/OpenSlides/issues/2278/labels{/name}","comments_url":"https://api.github.com/repos/OpenSlides/OpenSlides/issues/2278/comments","events_url":"https://api.github.com/repos/OpenSlides/OpenSlides/issues/2278/events","html_url":"https://github.com/OpenSlides/OpenSlides/issues/2278","id":171753744,"number":2278,"title":"Allow fake models for autoupdate cycle","user":{"login":"normanjaeckel","id":2073844,"avatar_url":"https://avatars.githubusercontent.com/u/2073844?v=3","gravatar_id":"","url":"https://api.github.com/users/normanjaeckel","html_url":"https://github.com/normanjaeckel","followers_url":"https://api.github.com/users/normanjaeckel/followers","following_url":"https://api.github.com/users/normanjaeckel/following{/other_user}","gists_url":"https://api.github.com/users/normanjaeckel/gists{/gist_id}","starred_url":"https://api.github.com/users/normanjaeckel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/normanjaeckel/subscriptions","organizations_url":"https://api.github.com/users/normanjaeckel/orgs","repos_url":"https://api.github.com/users/normanjaeckel/repos","events_url":"https://api.github.com/users/normanjaeckel/events{/privacy}","received_events_url":"https://api.github.com/users/normanjaeckel/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/OpenSlides/OpenSlides/labels/autoupdate","name":"autoupdate","color":"cccccc"},{"url":"https://api.github.com/repos/OpenSlides/OpenSlides/labels/high","name":"high","color":"d93f0b"}],"state":"open","locked":false,"assignee":{"login":"normanjaeckel","id":2073844,"avatar_url":"https://avatars.githubusercontent.com/u/2073844?v=3","gravatar_id":"","url":"https://api.github.com/users/normanjaeckel","html_url":"https://github.com/normanjaeckel","followers_url":"https://api.github.com/users/normanjaeckel/followers","following_url":"https://api.github.com/users/normanjaeckel/following{/other_user}","gists_url":"https://api.github.com/users/normanjaeckel/gists{/gist_id}","starred_url":"https://api.github.com/users/normanjaeckel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/normanjaeckel/subscriptions","organizations_url":"https://api.github.com/users/normanjaeckel/orgs","repos_url":"https://api.github.com/users/normanjaeckel/repos","events_url":"https://api.github.com/users/normanjaeckel/events{/privacy}","received_events_url":"https://api.github.com/users/normanjaeckel/received_events","type":"User","site_admin":false},"assignees":[{"login":"normanjaeckel","id":2073844,"avatar_url":"https://avatars.githubusercontent.com/u/2073844?v=3","gravatar_id":"","url":"https://api.github.com/users/normanjaeckel","html_url":"https://github.com/normanjaeckel","followers_url":"https://api.github.com/users/normanjaeckel/followers","following_url":"https://api.github.com/users/normanjaeckel/following{/other_user}","gists_url":"https://api.github.com/users/normanjaeckel/gists{/gist_id}","starred_url":"https://api.github.com/users/normanjaeckel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/normanjaeckel/subscriptions","organizations_url":"https://api.github.com/users/normanjaeckel/orgs","repos_url":"https://api.github.com/users/normanjaeckel/repos","events_url":"https://api.github.com/users/normanjaeckel/events{/privacy}","received_events_url":"https://api.github.com/users/normanjaeckel/received_events","type":"User","site_admin":false}],"milestone":{"url":"https://api.github.com/repos/OpenSlides/OpenSlides/milestones/21","html_url":"https://github.com/OpenSlides/OpenSlides/milestones/2.1","labels_url":"https://api.github.com/repos/OpenSlides/OpenSlides/milestones/21/labels","id":1291312,"number":21,"title":"2.1","description":"","creator":{"login":"ostcar","id":977937,"avatar_url":"https://avatars.githubusercontent.com/u/977937?v=3","gravatar_id":"","url":"https://api.github.com/users/ostcar","html_url":"https://github.com/ostcar","followers_url":"https://api.github.com/users/ostcar/followers","following_url":"https://api.github.com/users/ostcar/following{/other_user}","gists_url":"https://api.github.com/users/ostcar/gists{/gist_id}","starred_url":"https://api.github.com/users/ostcar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ostcar/subscriptions","organizations_url":"https://api.github.com/users/ostcar/orgs","repos_url":"https://api.github.com/users/ostcar/repos","events_url":"https://api.github.com/users/ostcar/events{/privacy}","received_events_url":"https://api.github.com/users/ostcar/received_events","type":"User","site_admin":false},"open_issues":113,"closed_issues":94,"state":"open","created_at":"2015-09-04T21:00:55Z","updated_at":"2016-08-19T20:42:56Z","due_on":null,"closed_at":null},"comments":2,"created_at":"2016-08-17T20:34:26Z","updated_at":"2016-08-20T05:03:00Z","closed_at":null,"body":"At the moment our autoupdate collections (see `collection_string`) have to be Django models. It is not possible to use an non Django model Python object to send information via autoupdate by a plugin. In autoupdate.py `send_data` we use `Model = get_model_from_collection_string(message['collection_string'])` and `instance = Model.objects.get(pk=message['pk'])` which force to use Django models.\r\n\r\nProposal: Lets add either some logic or a small layer in between so that plugins can create fake models to send calculated data to the clients. Example: A plugin wants to add an API endpoint. All users should be informed if this endpoint is triggered."},"comment":{"url":"https://api.github.com/repos/OpenSlides/OpenSlides/issues/comments/241179962","html_url":"https://github.com/OpenSlides/OpenSlides/issues/2278#issuecomment-241179962","issue_url":"https://api.github.com/repos/OpenSlides/OpenSlides/issues/2278","id":241179962,"user":{"login":"ostcar","id":977937,"avatar_url":"https://avatars.githubusercontent.com/u/977937?v=3","gravatar_id":"","url":"https://api.github.com/users/ostcar","html_url":"https://github.com/ostcar","followers_url":"https://api.github.com/users/ostcar/followers","following_url":"https://api.github.com/users/ostcar/following{/other_user}","gists_url":"https://api.github.com/users/ostcar/gists{/gist_id}","starred_url":"https://api.github.com/users/ostcar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ostcar/subscriptions","organizations_url":"https://api.github.com/users/ostcar/orgs","repos_url":"https://api.github.com/users/ostcar/repos","events_url":"https://api.github.com/users/ostcar/events{/privacy}","received_events_url":"https://api.github.com/users/ostcar/received_events","type":"User","site_admin":false},"created_at":"2016-08-20T05:03:00Z","updated_at":"2016-08-20T05:03:00Z","body":"I think fake_models sounds a bit hacky. It should also be possible, to send something else then a model to the clients. There could be a function send_custom_data(dict) that sends the dict to the client.\r\n\r\nThe bigger problem is the client side, which has to decide if a model is received or thomething else. But I think this can be solved. We already have a receiver on the client-side. So there can be more then one function on the client, that gets the data. Each function has to look at the data and decide, if it should do something with it or ignore it. For example:\r\n```javascript\r\nif ('collection' in data) {\r\n  do_something();\r\n} else {\r\n  ignore();\r\n}\r\n```"}}
{"actor":{"display_login":"ostcar"}}