Commit c03ececa authored by felix.herrmann's avatar felix.herrmann
Browse files

feat(maxlength): set max_length on all BleachField and CharField fields in dddatasets.models

parent 0c2418e5
# Generated by Django 2.2.12 on 2020-06-01 22:10
from django.db import migrations
import django_bleach.models
class Migration(migrations.Migration):
dependencies = [
('dddatasets', '0014_auto_20200520_1457'),
]
operations = [
migrations.AlterField(
model_name='category',
name='description',
field=django_bleach.models.BleachField(max_length=800),
),
migrations.AlterField(
model_name='dataset',
name='description',
field=django_bleach.models.BleachField(max_length=800, verbose_name='Technical description'),
),
migrations.AlterField(
model_name='dataset',
name='funding',
field=django_bleach.models.BleachField(blank=True, max_length=400),
),
migrations.AlterField(
model_name='dataset',
name='institutional_affiliation',
field=django_bleach.models.BleachField(blank=True, max_length=400),
),
migrations.AlterField(
model_name='dataset',
name='related_dataset_text',
field=django_bleach.models.BleachField(blank=True, max_length=800),
),
migrations.AlterField(
model_name='dataset',
name='sources_of_data',
field=django_bleach.models.BleachField(max_length=800),
),
migrations.AlterField(
model_name='datasetexternallink',
name='site_text',
field=django_bleach.models.BleachField(blank=True, help_text='In-depth description of the external repository or web site', max_length=800),
),
migrations.AlterField(
model_name='documentation',
name='text',
field=django_bleach.models.BleachField(blank=True, max_length=800),
),
migrations.AlterField(
model_name='license',
name='individual_license',
field=django_bleach.models.BleachField(blank=True, max_length=800),
),
]
......@@ -67,7 +67,7 @@ class Category(models.Model):
name = models.CharField(max_length=400)
slug = models.CharField(max_length=400)
image = models.ImageField(blank=True, null=True)
description = BleachField()
description = BleachField(max_length=800)
sponsors = models.ManyToManyField(
"Sponsor", blank=True, related_name="category_sponsors_sponsor"
)
......@@ -199,7 +199,7 @@ class License(models.Model):
related_name="license_license_page",
on_delete=models.PROTECT,
)
individual_license = BleachField(blank=True)
individual_license = BleachField(blank=True, max_length=800)
def get_license_name(self):
if self.license_type == "STD":
......@@ -278,7 +278,7 @@ class Documentation(models.Model):
docu_type = models.CharField(max_length=3, choices=DOCU_TYPES, default="GEN",)
file = models.FileField(blank=True, null=True) # upload_to='datasets/')
description = BleachField(max_length=280, blank=True)
text = BleachField(blank=True)
text = BleachField(blank=True, max_length=800)
public = models.BooleanField(default=False)
def __str__(self):
......@@ -323,6 +323,7 @@ class DataSetExternalLink(models.Model):
)
site_text = BleachField(
blank=True,
max_length=800,
help_text=_("In-depth description of the external repository or web site"),
)
......@@ -408,9 +409,9 @@ class DataSet(models.Model):
datatypes = models.ManyToManyField(
"DataType", related_name="dataset_datatypes_datatype"
)
description = BleachField(verbose_name="Technical description")
description = BleachField(verbose_name="Technical description", max_length=800)
keyword_tags = TaggableManager("KeywordTags", blank=True, through=KeywordTags)
sources_of_data = BleachField()
sources_of_data = BleachField(max_length=800)
languages_of_data = TaggableManager(
"LanguageTags", blank=True, through=LanguageTags
)
......@@ -448,7 +449,7 @@ class DataSet(models.Model):
null=True,
)
related_dataset_text = BleachField(blank=True)
related_dataset_text = BleachField(blank=True, max_length=800)
related_dataset = models.ManyToManyField(
"DataSet",
related_name="dataset_related_dataset_dataset",
......@@ -456,11 +457,11 @@ class DataSet(models.Model):
help_text=_("Undo choice with CTRL–Mouse Click"),
)
# context = models.TextField(blank=True,)
institutional_affiliation = BleachField(blank=True,)
institutional_affiliation = BleachField(blank=True, max_length=400)
sponsors = models.ManyToManyField(
"Sponsor", blank=True, related_name="dataset_sponsors"
)
funding = BleachField(blank=True,)
funding = BleachField(blank=True, max_length=400)
publications = models.ManyToManyField(
"ddpublications.Publication",
blank=True,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment