Skip to content

Added required on_delete attribute to OneToOneField field. #4838

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

Merged
merged 1 commit into from
Jan 24, 2017

Conversation

felixxm
Copy link
Contributor

@felixxm felixxm commented Jan 23, 2017

Added missing on_delete attribute to OneToOneField. on_delete is required since Django 2.0.

==================================== ERRORS ====================================
__________ ERROR collecting tests/test_one_to_one_with_inheritance.py __________
tests/test_one_to_one_with_inheritance.py:16: in <module>
    class ChildAssociatedModel(RESTFrameworkModel):
tests/test_one_to_one_with_inheritance.py:17: in ChildAssociatedModel
    child_model = models.OneToOneField(ChildModel)
E   TypeError: __init__() missing 1 required positional argument: 'on_delete'

@tomchristie
Copy link
Member

Yup looks good. Happy to merge this once the tests pass. Thanks!

@tomchristie tomchristie merged commit 6b399f1 into encode:master Jan 24, 2017
@felixxm felixxm deleted the issue-on_delete branch January 24, 2017 18:27
vpistis added a commit to vpistis/django-rest-framework that referenced this pull request Feb 6, 2017
* master: (95 commits)
  Add max_length and min_length arguments for ListField (encode#4877)
  Update sponsors on README to include rollbar (encode#4876)
  Added Rollbar to premium sponsors
  fixed url checker ':' to 'http' (encode#4678)
  Fixed `dedent` for tab indent.
  Add test for pagination when limit not set
  Fixed Django 2.0 compatibility due to `django.conf.urls.include` parameters change. (encode#4866)
  Add remaining tests for generics (encode#4865)
  Removed unnecessary importlib wrapper.
  Updated Support section and added funding email (encode#4860)
  Git add remaining tests for BaseSerializer (encode#4857)
  Update machinalis links
  Updated Machinalis links (encode#4856)
  Add remaining tests for metadata (encode#4855)
  Fixed encode#4574 -- Removed multi-table inheritance auto created PK from serialize. (encode#4852)
  Add couple of tests for filters (encode#4849)
  Refactor according to comments in PR (encode#4848)
  Add couple of tests for compat module (encode#4845)
  Direct readers to info on how to add viewset docs (encode#4844)
  Fixed test_one_to_one_with_inheritance. Added required on_delete attribute to OneToOneField field. (encode#4838)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants