{"action":"created","issue":{"url":"https://api.github.com/repos/stephenmcd/mezzanine/issues/1019","labels_url":"https://api.github.com/repos/stephenmcd/mezzanine/issues/1019/labels{/name}","comments_url":"https://api.github.com/repos/stephenmcd/mezzanine/issues/1019/comments","events_url":"https://api.github.com/repos/stephenmcd/mezzanine/issues/1019/events","html_url":"https://github.com/stephenmcd/mezzanine/pull/1019","id":32318585,"number":1019,"title":"Integrates django-modeltranslation as an optional app à la south","user":{"login":"Kniyl","id":2686934,"avatar_url":"https://avatars.githubusercontent.com/u/2686934?v=3","gravatar_id":"","url":"https://api.github.com/users/Kniyl","html_url":"https://github.com/Kniyl","followers_url":"https://api.github.com/users/Kniyl/followers","following_url":"https://api.github.com/users/Kniyl/following{/other_user}","gists_url":"https://api.github.com/users/Kniyl/gists{/gist_id}","starred_url":"https://api.github.com/users/Kniyl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Kniyl/subscriptions","organizations_url":"https://api.github.com/users/Kniyl/orgs","repos_url":"https://api.github.com/users/Kniyl/repos","events_url":"https://api.github.com/users/Kniyl/events{/privacy}","received_events_url":"https://api.github.com/users/Kniyl/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":64,"created_at":"2014-04-27T19:27:16Z","updated_at":"2015-03-04T23:51:18Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/stephenmcd/mezzanine/pulls/1019","html_url":"https://github.com/stephenmcd/mezzanine/pull/1019","diff_url":"https://github.com/stephenmcd/mezzanine/pull/1019.diff","patch_url":"https://github.com/stephenmcd/mezzanine/pull/1019.patch"},"body":"I finally decided to take the time to integrate my wrapper shown in #106 into mezzanine. The code is far better that way.\r\n\r\nOne downside though:\r\n\r\n```\r\n======================================================================\r\nERROR: test_mulisite (mezzanine.core.tests.CoreTests)\r\n----------------------------------------------------------------------\r\nTraceback (most recent call last):\r\n  File \"/home/mathias/PkgBuilding/mezzanine_devel/lib/python3.4/site-packages/django/db/models/fields/related.py\", line 303, in __get__\r\n    rel_obj = getattr(instance, self.cache_name)\r\nAttributeError: 'RichTextPage' object has no attribute '_page_ptr_cache'\r\n\r\nDuring handling of the above exception, another exception occurred:\r\n\r\nTraceback (most recent call last):\r\n  File \"/home/mathias/PkgBuilding/mezzanine_devel/mezzanine/mezzanine/core/tests.py\", line 238, in test_mulisite\r\n    site1.delete()\r\n  File \"/home/mathias/PkgBuilding/mezzanine_devel/lib/python3.4/site-packages/django/db/models/base.py\", line 694, in delete\r\n    collector.collect([self])\r\n  File \"/home/mathias/PkgBuilding/mezzanine_devel/lib/python3.4/site-packages/django/db/models/deletion.py\", line 197, in collect\r\n    field.rel.on_delete(self, field, sub_objs, self.using)\r\n  File \"/home/mathias/PkgBuilding/mezzanine_devel/lib/python3.4/site-packages/django/db/models/deletion.py\", line 17, in CASCADE\r\n    source_attr=field.name, nullable=field.null)\r\n  File \"/home/mathias/PkgBuilding/mezzanine_devel/lib/python3.4/site-packages/django/db/models/deletion.py\", line 197, in collect\r\n    field.rel.on_delete(self, field, sub_objs, self.using)\r\n  File \"/home/mathias/PkgBuilding/mezzanine_devel/lib/python3.4/site-packages/django/db/models/deletion.py\", line 17, in CASCADE\r\n    source_attr=field.name, nullable=field.null)\r\n  File \"/home/mathias/PkgBuilding/mezzanine_devel/lib/python3.4/site-packages/django/db/models/deletion.py\", line 181, in collect\r\n    parent_objs = [getattr(obj, ptr.name) for obj in new_objs]\r\n  File \"/home/mathias/PkgBuilding/mezzanine_devel/lib/python3.4/site-packages/django/db/models/deletion.py\", line 181, in <listcomp>\r\n    parent_objs = [getattr(obj, ptr.name) for obj in new_objs]\r\n  File \"/home/mathias/PkgBuilding/mezzanine_devel/lib/python3.4/site-packages/django/db/models/fields/related.py\", line 320, in __get__\r\n    rel_obj = qs.get()\r\n  File \"/home/mathias/PkgBuilding/mezzanine_devel/lib/python3.4/site-packages/django/db/models/query.py\", line 307, in get\r\n    self.model._meta.object_name)\r\nmezzanine.pages.models.DoesNotExist: Page matching query does not exist.\r\n```\r\n\r\nI tried to investigate why this is happening but I lack knowledge about the internals of mezzanine and django-modeltranslation. It can be that when models are registered for translation, their managers are not correctly patched but I’m very unsure about this.\r\n\r\nAnyway, this issue has a workaround since it happens only when one tries to delete a ```Site``` with remaining ```Pages``` attached to it. If all pages are deleted beforehand, the ```Site``` delete smoothly."},"comment":{"url":"https://api.github.com/repos/stephenmcd/mezzanine/issues/comments/77276935","html_url":"https://github.com/stephenmcd/mezzanine/pull/1019#issuecomment-77276935","issue_url":"https://api.github.com/repos/stephenmcd/mezzanine/issues/1019","id":77276935,"user":{"login":"stephenmcd","id":116385,"avatar_url":"https://avatars.githubusercontent.com/u/116385?v=3","gravatar_id":"","url":"https://api.github.com/users/stephenmcd","html_url":"https://github.com/stephenmcd","followers_url":"https://api.github.com/users/stephenmcd/followers","following_url":"https://api.github.com/users/stephenmcd/following{/other_user}","gists_url":"https://api.github.com/users/stephenmcd/gists{/gist_id}","starred_url":"https://api.github.com/users/stephenmcd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stephenmcd/subscriptions","organizations_url":"https://api.github.com/users/stephenmcd/orgs","repos_url":"https://api.github.com/users/stephenmcd/repos","events_url":"https://api.github.com/users/stephenmcd/events{/privacy}","received_events_url":"https://api.github.com/users/stephenmcd/received_events","type":"User","site_admin":false},"created_at":"2015-03-04T23:51:17Z","updated_at":"2015-03-04T23:51:17Z","body":"Just reviewed this again and I think the UI works well.\r\n\r\nOne question - how does caching come into play? Currently with a production deploy, we enable caching of all pages using URLs as keys - it seems like the default setup with modeltranslation at the moment doesn't prefix URLs with language, eg foo.com/en/some-page, so would we end up with cached content for one language showing when another language has been selected?\r\n\r\nWe'll also need to squash the 30+ commits into one once this is ready, as each commit message gets put into the changelog.\r\n\r\n"}}