diff --git a/django_celery_beat/migrations/0001_initial.py b/django_celery_beat/migrations/0001_initial.py index 3c8ae4dd..0ff64565 100644 --- a/django_celery_beat/migrations/0001_initial.py +++ b/django_celery_beat/migrations/0001_initial.py @@ -1,5 +1,6 @@ # Generated by Django 1.9.5 on 2016-08-04 02:13 from django.db import migrations, models +from django.conf import settings import django.db.models.deletion @@ -68,7 +69,12 @@ class Migration(migrations.Migration): auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('name', models.CharField( - help_text='Useful description', max_length=200, + help_text='Useful description', + max_length=getattr( + settings, + 'DJANGO_CELERY_BEAT_PERIODICTASK_NAME_MAX_LENGTH', + 200 + ), unique=True, verbose_name='name')), ('task', models.CharField( max_length=200, verbose_name='task name')), diff --git a/django_celery_beat/migrations/0010_auto_20190429_0326.py b/django_celery_beat/migrations/0010_auto_20190429_0326.py index ae948ddf..c360aebe 100644 --- a/django_celery_beat/migrations/0010_auto_20190429_0326.py +++ b/django_celery_beat/migrations/0010_auto_20190429_0326.py @@ -5,6 +5,7 @@ import django.core.validators from django.db import migrations, models import django.db.models.deletion +from django.conf import settings import django_celery_beat.validators import timezone_field.fields @@ -114,7 +115,16 @@ class Migration(migrations.Migration): migrations.AlterField( model_name='periodictask', name='name', - field=models.CharField(help_text='Short Description For This Task', max_length=200, unique=True, verbose_name='Name'), + field=models.CharField( + help_text='Short Description For This Task', + max_length=getattr( + settings, + 'DJANGO_CELERY_BEAT_PERIODICTASK_NAME_MAX_LENGTH', + 200 + ), + unique=True, + verbose_name='Name' + ), ), migrations.AlterField( model_name='periodictask', diff --git a/django_celery_beat/models.py b/django_celery_beat/models.py index 583d8b63..f8d01a8a 100644 --- a/django_celery_beat/models.py +++ b/django_celery_beat/models.py @@ -386,7 +386,12 @@ class PeriodicTask(models.Model): """Model representing a periodic task.""" name = models.CharField( - max_length=200, unique=True, + max_length=getattr( + settings, + 'DJANGO_CELERY_BEAT_PERIODICTASK_NAME_MAX_LENGTH', + 200 + ), + unique=True, verbose_name=_('Name'), help_text=_('Short Description For This Task'), )