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

django 2.0, missing 1 required positional argument: 'on_delete' #76

Closed
darahsten opened this issue Dec 17, 2017 · 5 comments
Closed

django 2.0, missing 1 required positional argument: 'on_delete' #76

darahsten opened this issue Dec 17, 2017 · 5 comments

Comments

@darahsten
Copy link

File "/home/user/.virtualenvs/rola/lib/python3.5/site-packages/address/models.py", line 171, in State
country = models.ForeignKey(Country, related_name='states')
TypeError: init() missing 1 required positional argument: 'on_delete'.
Django 2.0 requires on_delete to be explicitly set. Hence using this with django 2.0 results in the above missing positional argument.

@arbeiterz
Copy link
Contributor

There was a recent pull request merged into master that appeared aimed at fixing this issue and other issues related to Django 2.0 and Python 3.6.0 but it didn't seem to catch everything when I worked with it. Considering submitting another pull request for consideration myself. Not completely sure that I'm doing everything correctly but I did manage to get it working.

klowe0100 added a commit to klowe0100/django-address that referenced this issue Dec 24, 2017
Overloaded init needs to set on_delete

virtual_only has been renamed to private_only
django/django@c339a5a

Refs furious-luke#76
klowe0100 added a commit to klowe0100/django-address that referenced this issue Dec 24, 2017
virtual_only has been renamed to private_only
django/django@c339a5a

Refs furious-luke#76
@yaplej
Copy link

yaplej commented Mar 27, 2018

I'm having this issue too. Getting close to another release to pypi?
#72

@karbassi
Copy link
Contributor

karbassi commented Apr 1, 2018

Fixed in #78

@smobbl-bobbl
Copy link

The issue still exists on different position of models:
File "/usr/lib/python3.4/site-packages/django_address-0.1.6-py3.4.egg/address/models.py", line 310, in __init__
super(AddressField, self).__init__(*args, **kwargs)
TypeError: __init__() missing 1 required positional argument: 'on_delete'
I am not too familiar with github, but i assume i downloaded the most recent version of django-address

@karbassi
Copy link
Contributor

@smobbl-bobbl: We're waiting for @furious-luke to push a new version of this package. v0.1.7 should have this fix.

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

No branches or pull requests

5 participants