etianen / django-watson

Full-text multi-table search application for Django. Easy to install and use, with good performance.
BSD 3-Clause "New" or "Revised" License
1.2k stars 130 forks source link

Avoid "RemovedInDjango20Warning: on_delete will be a required arg for ForeignKey in Django 2.0" with recent versions of Django #212

Closed alorence closed 7 years ago

alorence commented 7 years ago

As explained in documentation, on_delete argument in models.ForeignKey() will become required starting from Django 2.0. Since Django 1.9 and higher thrown a warning when it is missing, it should be always set. Note: on Django 1.11, warning is visible only with -W command line argument. Example: python -Wd manage.py runserver

When the argument is omitted, the default value is CASCADE. So it is safe to set this value to models.CASCADE.

etianen commented 7 years ago

Many thanks!