diff --git a/djangocms_blog/migrations/0032_auto_20180109_0023.py b/djangocms_blog/migrations/0032_auto_20180109_0023.py
index 15e0f94..2f248f6 100644
--- a/djangocms_blog/migrations/0032_auto_20180109_0023.py
+++ b/djangocms_blog/migrations/0032_auto_20180109_0023.py
@@ -21,12 +21,12 @@ class Migration(migrations.Migration):
migrations.AlterField(
model_name='blogcategorytranslation',
name='name',
- field=models.CharField(max_length=2000, verbose_name='name'),
+ field=models.CharField(max_length=767, verbose_name='name'),
),
migrations.AlterField(
model_name='blogcategorytranslation',
name='slug',
- field=models.SlugField(blank=True, max_length=2000, verbose_name='slug'),
+ field=models.SlugField(blank=True, max_length=767, verbose_name='slug'),
),
migrations.AlterField(
model_name='posttranslation',
@@ -36,11 +36,11 @@ class Migration(migrations.Migration):
migrations.AlterField(
model_name='posttranslation',
name='slug',
- field=djangocms_blog.fields.AutoSlugField(allow_unicode=True, blank=True, db_index=False, max_length=2000, verbose_name='slug'),
+ field=djangocms_blog.fields.AutoSlugField(allow_unicode=True, blank=True, db_index=False, max_length=767, verbose_name='slug'),
),
migrations.AlterField(
model_name='posttranslation',
name='title',
- field=models.CharField(max_length=2000, verbose_name='title'),
+ field=models.CharField(max_length=767, verbose_name='title'),
),
]
diff --git a/djangocms_blog/models.py b/djangocms_blog/models.py
index bfafc43..47de024 100644
--- a/djangocms_blog/models.py
+++ b/djangocms_blog/models.py
@@ -92,8 +92,8 @@ class BlogCategory(BlogMetaMixin, TranslatableModel):
)
translations = TranslatedFields(
- name=models.CharField(_('name'), max_length=2000),
- slug=models.SlugField(_('slug'), max_length=2000, blank=True, db_index=True),
+ name=models.CharField(_('name'), max_length=767),
+ slug=models.SlugField(_('slug'), max_length=767, blank=True, db_index=True),
meta_description=models.TextField(
verbose_name=_('category meta description'), blank=True, default=''
),
@@ -227,8 +227,8 @@ class Post(KnockerModel, BlogMetaMixin, TranslatableModel):
)
translations = TranslatedFields(
- title=models.CharField(_('title'), max_length=2000),
- slug=AutoSlugField(_('slug'), max_length=2000, blank=True,
+ title=models.CharField(_('title'), max_length=767),
+ slug=AutoSlugField(_('slug'), max_length=767, blank=True,
db_index=True, allow_unicode=True),
abstract=HTMLField(_('abstract'), blank=True, default=''),
meta_description=models.TextField(verbose_name=_('post meta description'),
diff --git a/tests/test_models.py b/tests/test_models.py
index 812687d..bc62016 100644
--- a/tests/test_models.py
+++ b/tests/test_models.py
@@ -82,12 +82,12 @@ class AdminTest(BaseTest):
# Add view only contains the apphook selection widget
response = post_admin.add_view(request)
- self.assertNotContains(response, 'Blog / sample_app' % self.app_config_1.pk)
# Changeview is 'normal'
response = post_admin.change_view(request, str(post.pk))
- self.assertContains(response, '')
+ self.assertContains(response, '')
self.assertContains(response, 'id="id_meta_description" maxlength="320"')
self.assertContains(response, '' % self.app_config_1.pk)
@@ -184,12 +184,12 @@ class AdminTest(BaseTest):
# Add view only has an empty form - no type
response = category_admin.add_view(request)
- self.assertNotContains(response, 'id="id_name" maxlength="2000" name="name" type="text" value="category 1"')
+ self.assertNotContains(response, 'id="id_name" maxlength="767" name="name" type="text" value="category 1"')
self.assertContains(response, '' % self.app_config_1.pk)
# Changeview is 'normal', with a few preselected items
response = category_admin.change_view(request, str(self.category_1.pk))
- self.assertContains(response, 'id="id_name" maxlength="2000" name="name" type="text" value="category 1"')
+ self.assertContains(response, 'id="id_name" maxlength="767" name="name" type="text" value="category 1"')
self.assertContains(response, 'id="id_meta_description" maxlength="320"')
self.assertContains(response, '' % self.app_config_1.pk)