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

TypeError: __init__() missing 1 required positional argument: 'on_delete' #28

Open
a-maryam opened this issue Jul 16, 2019 · 0 comments

Comments

@a-maryam
Copy link

a-maryam commented Jul 16, 2019

Location 1

File "/srv/venv/lib/python3.5/site-packages/flatcontent/models.py", line 13, in FlatContent
site = models.ForeignKey(Site, blank=True, null=True)
TypeError: init() missing 1 required positional argument: 'on_delete'

Location 2

File "/srv/venv/lib/python3.5/site-packages/flatcontent/migrations/0001_initial.py", line 20, in Migration
('site', models.ForeignKey(to='sites.Site', null=True, blank=True)),
TypeError: init() missing 1 required positional argument: 'on_delete'

Location 3

File "/srv/venv/lib/python3.5/site-packages/flatcontent/migrations/0001_initial.py", line 20, in Migration
('site', models.ForeignKey(to='sites.Site', null=True, blank=True)),
TypeError: init() missing 1 required positional argument: 'on_delete'

Fix (Disclaimer: Not acquainted with the possible repercussions)

add on_delete=models.PROTECT to the foreign key arguments

Source

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

1 participant