pinax / pinax-blog

a blog app for Django
MIT License
465 stars 153 forks source link

Missing on_delete argument, first migration fail #106

Closed Hugodby closed 6 years ago

Hugodby commented 6 years ago

Hello,

I am trying to setup pinax-blog on a Django 2.0 application. However I am not able to execute the migration.

File ".../venv/lib/python3.6/site-packages/pinax/blog/migrations/0001_initial.py", line 56, in Migration
    ('author', models.ForeignKey(related_name='posts', to=settings.AUTH_USER_MODEL)),
TypeError: __init__() missing 1 required positional argument: 'on_delete'

If I understand correctly the ForeignKey field miss the on_delete argument used on newer Django version. https://docs.djangoproject.com/en/2.0/ref/models/fields/#django.db.models.ForeignKey.on_delete Should I open a PR ? Which value on_delete needs to be setted ? Thank you

grahamu commented 6 years ago

Thanks @Hugodby , this is fixed in https://github.com/pinax/pinax-blog/pull/107. You can see the result in the most recent release, v7.0.0. https://pypi.python.org/pypi/pinax-blog.