{"action":"opened","issue":{"url":"https://api.github.com/repos/justquick/django-activity-stream/issues/267","labels_url":"https://api.github.com/repos/justquick/django-activity-stream/issues/267/labels{/name}","comments_url":"https://api.github.com/repos/justquick/django-activity-stream/issues/267/comments","events_url":"https://api.github.com/repos/justquick/django-activity-stream/issues/267/events","html_url":"https://github.com/justquick/django-activity-stream/issues/267","id":114137103,"number":267,"title":"Not compatible with Wagtail","user":{"login":"bufke","id":739307,"avatar_url":"https://avatars.githubusercontent.com/u/739307?v=3","gravatar_id":"","url":"https://api.github.com/users/bufke","html_url":"https://github.com/bufke","followers_url":"https://api.github.com/users/bufke/followers","following_url":"https://api.github.com/users/bufke/following{/other_user}","gists_url":"https://api.github.com/users/bufke/gists{/gist_id}","starred_url":"https://api.github.com/users/bufke/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bufke/subscriptions","organizations_url":"https://api.github.com/users/bufke/orgs","repos_url":"https://api.github.com/users/bufke/repos","events_url":"https://api.github.com/users/bufke/events{/privacy}","received_events_url":"https://api.github.com/users/bufke/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-10-29T20:18:50Z","updated_at":"2015-10-29T20:18:50Z","closed_at":null,"body":"Using this with Wagtail CMS can cause errors when using registry.register with a wagtail Page. \r\n\r\nhttps://github.com/torchbox/wagtail/issues/1852\r\n\r\nVery similar to #48\r\n\r\nHacky solution based on #48's workaround\r\n\r\nRegister models using this function instead\r\n\r\n```\r\nfrom actstream import registry as activity_stream_registry\r\nfrom actstream.models import Action\r\n\r\ndef register_actstream_model(model_class):\r\n    activity_stream_registry.register(model_class)\r\n    for field in ('actor', 'target', 'action_object'):\r\n        field.auto_created = True\r\n```\r\n\r\nWhy does it work? wagtail ignores reverse relations by checking field.auto_created. So we just set that to True."}}