Django-celery-beat: Add `on_delete` to ForeignKeys

Created on 9 May 2017  路  1Comment  路  Source: celery/django-celery-beat

When attempting to use celery-beat with the current master Django branch, I get the following error messages:

TypeError: __init__() missing 1 required positional argument: 'on_delete'
django_celery_beat/models.py:176: RemovedInDjango20Warning: on_delete will be a required arg for ForeignKey in Django 2.0. Set it to models.CASCADE on models and in existing migrations if you want to maintain the current default behavior. See https://docs.djangoproject.com/en/1.11/ref/models/fields/#django.db.models.ForeignKey.on_delete
  null=True, blank=True, verbose_name=_('interval'),



md5-66213cdd53c867df8c45b14f9db1fcf4



Deprecated since version 1.9:
on_delete will become a required argument in Django 2.0. In older versions it defaults to CASCADE.

This should be safe to set explicitly to CASCADE on all ForeignKeys, as this will maintain legacy behavior, and on_delete has been an available option since before 1.8, which is the oldest version currently supported by this package.

Most helpful comment

Now that Django 2.0 alpha is out, it would be great to get this released.

>All comments

Now that Django 2.0 alpha is out, it would be great to get this released.

Was this page helpful?
0 / 5 - 0 ratings