{"action":"created","issue":{"url":"https://api.github.com/repos/treyhunner/django-simple-history/issues/224","repository_url":"https://api.github.com/repos/treyhunner/django-simple-history","labels_url":"https://api.github.com/repos/treyhunner/django-simple-history/issues/224/labels{/name}","comments_url":"https://api.github.com/repos/treyhunner/django-simple-history/issues/224/comments","events_url":"https://api.github.com/repos/treyhunner/django-simple-history/issues/224/events","html_url":"https://github.com/treyhunner/django-simple-history/issues/224","id":160807038,"number":224,"title":"Wrong table name when using abstract models","user":{"login":"rougeth","id":431892,"avatar_url":"https://avatars.githubusercontent.com/u/431892?v=3","gravatar_id":"","url":"https://api.github.com/users/rougeth","html_url":"https://github.com/rougeth","followers_url":"https://api.github.com/users/rougeth/followers","following_url":"https://api.github.com/users/rougeth/following{/other_user}","gists_url":"https://api.github.com/users/rougeth/gists{/gist_id}","starred_url":"https://api.github.com/users/rougeth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rougeth/subscriptions","organizations_url":"https://api.github.com/users/rougeth/orgs","repos_url":"https://api.github.com/users/rougeth/repos","events_url":"https://api.github.com/users/rougeth/events{/privacy}","received_events_url":"https://api.github.com/users/rougeth/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-06-17T03:50:37Z","updated_at":"2016-06-26T06:48:31Z","closed_at":null,"body":"Hello people,\r\n\r\nWhat's the expected table name for a history model when I'm using an abstract model like this?\r\n```\r\n# core/models.py\r\nclass HistoryMixin(models.Model):\r\n    history = HistoricalRecords(inherit=True)\r\n    class Meta:\r\n        abstract = True\r\n\r\nclass SameModuleModel(HistoryMixin, models.Model):\r\n    pass\r\n\r\n# app1/models.py\r\nclass AnotherAppModel(HistoryMixin, models.Model):\r\n    pass\r\n```\r\nIn this example, the `makemigrations` output is:\r\n```\r\nMigrations for 'core':\r\n  0001_initial.py:\r\n    - Create model HistoricalAnotherAppModel\r\n    - Create model HistoricalSameModuleModel\r\n    - Create model SameModuleModel\r\nMigrations for 'app1':\r\n  0001_initial.py:\r\n    - Create model AnotherAppModel\r\n```\r\nAll models that inherit from `HistoryMixin` will have its history db table named like `core_historicalmodel_name` and not like `model_module_using_HistoryMixin_historicalmodel_name`.\r\n\r\nAm I not seeing something here?\r\n\r\nThanks."},"comment":{"url":"https://api.github.com/repos/treyhunner/django-simple-history/issues/comments/228587310","html_url":"https://github.com/treyhunner/django-simple-history/issues/224#issuecomment-228587310","issue_url":"https://api.github.com/repos/treyhunner/django-simple-history/issues/224","id":228587310,"user":{"login":"gabn88","id":7912953,"avatar_url":"https://avatars.githubusercontent.com/u/7912953?v=3","gravatar_id":"","url":"https://api.github.com/users/gabn88","html_url":"https://github.com/gabn88","followers_url":"https://api.github.com/users/gabn88/followers","following_url":"https://api.github.com/users/gabn88/following{/other_user}","gists_url":"https://api.github.com/users/gabn88/gists{/gist_id}","starred_url":"https://api.github.com/users/gabn88/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gabn88/subscriptions","organizations_url":"https://api.github.com/users/gabn88/orgs","repos_url":"https://api.github.com/users/gabn88/repos","events_url":"https://api.github.com/users/gabn88/events{/privacy}","received_events_url":"https://api.github.com/users/gabn88/received_events","type":"User","site_admin":false},"created_at":"2016-06-26T06:48:30Z","updated_at":"2016-06-26T06:48:30Z","body":"If I use the registration approach (register(AbstractAddress, inherit=True)), I get\r\n\r\n    from address.abstract_models import AbstractAddress\r\n  File \"address/abstract_models.py\", line 175, in <module>\r\n    register(AbstractAddress, inherit=True)\r\n  File \"/site-packages/simple_history/__init__.py\", line 33, in register\r\n    records.finalize(model)\r\n  File \"/site-packages/simple_history/models.py\", line 88, in finalize\r\n    history_model = self.create_history_model(sender)\r\n  File \"/site-packages/simple_history/models.py\", line 116, in create_history_model\r\n    app = apps.app_configs[model._meta.app_label]\r\nKeyError: 'address'\r\n\r\nMy Meta is:\r\n    class Meta:\r\n        abstract = True\r\n        verbose_name = _('Address')\r\n        verbose_name_plural = _('Addresses')\r\n\r\n\r\nOr are abstract models not supported?"}}
{"actor":{"display_login":"gabn88"}}