Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Warn when using HistoricalRecords on an abstract class without inherit=True #341

Closed
konstin opened this issue Jan 14, 2018 · 2 comments · Fixed by #472
Closed

Warn when using HistoricalRecords on an abstract class without inherit=True #341

konstin opened this issue Jan 14, 2018 · 2 comments · Fixed by #472
Labels
bug Issues related to confirmed bugs good-first-issue

Comments

@konstin
Copy link

konstin commented Jan 14, 2018

Adding a HistoricalRecords to an abstract model without inherit=True unlike most other Field types doesn't do anything. It should therefore trigger a warning with a hint to inherit=True.

class CommonFields(models.Model):
    history = HistoricalRecords()

    class Meta:
        abstract = True

class Foo(CommonFields):
    pass
@rossmechanic rossmechanic added good-first-issue bug Issues related to confirmed bugs labels Apr 9, 2018
absolutelysimon pushed a commit to absolutelysimon/django-simple-history that referenced this issue Oct 18, 2018
rossmechanic pushed a commit that referenced this issue Oct 31, 2018
rossmechanic pushed a commit that referenced this issue Oct 31, 2018
…ass (#472)

* First commit for issue #341 - Warning if inerhit is set to False in an abstract class

* First commit for issue #341 - Warning if inerhit is set to False in an abstract class

* Fixed flake8 errors and tested that warning is raised

* Added changes.rst

* Updated warning with tests to improve coverage
@shakyasaijal
Copy link

history = HistoricalRecords(inherit = True)

Reference

a6fddd6

@ShedrackGodson
Copy link

class ClassName(models.Model):
     history = HistoricalRecords(inherit=True)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issues related to confirmed bugs good-first-issue
Projects
None yet
4 participants