Commit 7aeec929 authored by Florent Chehab's avatar Florent Chehab

Small update on backend texts fields

parent a0e5e515
# Generated by Django 2.0.3 on 2018-09-15 11:41
# Generated by Django 2.0.3 on 2018-09-16 13:31
import backend.fields
import backend.models.abstract.my_model.myModel
......@@ -14,8 +14,8 @@ class Migration(migrations.Migration):
initial = True
dependencies = [
('contenttypes', '0002_remove_content_type_name'),
('auth', '0009_alter_user_last_name_max_length'),
('contenttypes', '0002_remove_content_type_name'),
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
......@@ -27,9 +27,12 @@ class Migration(migrations.Migration):
('moderated_on', models.DateTimeField(null=True)),
('updated_on', models.DateTimeField(null=True)),
('obj_moderation_level', models.SmallIntegerField(default=0, validators=[django.core.validators.MinValueValidator(0), backend.models.abstract.my_model.myModel.validate_obj_model_lv])),
('title', models.CharField(default='', max_length=150)),
('comment', models.CharField(default='', max_length=5000)),
('useful_links', backend.fields.JSONField(default=list)),
('importance_level', models.CharField(choices=[('-', 'normal'), ('+', 'important'), ('++', 'IMPORTANT')], default='-', max_length=2)),
('is_main_campus', models.BooleanField()),
('name', models.CharField(max_length=200, null=True)),
('comment', models.TextField(blank=True, null=True)),
('name', models.CharField(default='', max_length=200)),
('lat', models.DecimalField(decimal_places=6, max_digits=10, validators=[django.core.validators.MinValueValidator(-85.05112878), django.core.validators.MaxValueValidator(85.05112878)])),
('lon', models.DecimalField(decimal_places=6, max_digits=10, validators=[django.core.validators.MinValueValidator(-180), django.core.validators.MaxValueValidator(180)])),
],
......@@ -42,7 +45,7 @@ class Migration(migrations.Migration):
('updated_on', models.DateTimeField(null=True)),
('obj_moderation_level', models.SmallIntegerField(default=0, validators=[django.core.validators.MinValueValidator(0), backend.models.abstract.my_model.myModel.validate_obj_model_lv])),
('title', models.CharField(default='', max_length=150)),
('comment', models.TextField(blank=True, default='')),
('comment', models.CharField(default='', max_length=5000)),
('useful_links', backend.fields.JSONField(default=list)),
('importance_level', models.CharField(choices=[('-', 'normal'), ('+', 'important'), ('++', 'IMPORTANT')], default='-', max_length=2)),
('custom_content', backend.fields.JSONField(default=dict)),
......@@ -57,8 +60,8 @@ class Migration(migrations.Migration):
('updated_on', models.DateTimeField(null=True)),
('obj_moderation_level', models.SmallIntegerField(default=0, validators=[django.core.validators.MinValueValidator(0), backend.models.abstract.my_model.myModel.validate_obj_model_lv])),
('name', models.CharField(max_length=200)),
('local_name', models.CharField(blank=True, max_length=200, null=True)),
('area', models.CharField(blank=True, max_length=200, null=True)),
('local_name', models.CharField(default='', max_length=200)),
('area', models.CharField(default='', max_length=200)),
],
options={
'abstract': False,
......@@ -72,7 +75,7 @@ class Migration(migrations.Migration):
('updated_on', models.DateTimeField(null=True)),
('obj_moderation_level', models.SmallIntegerField(default=0, validators=[django.core.validators.MinValueValidator(0), backend.models.abstract.my_model.myModel.validate_obj_model_lv])),
('title', models.CharField(default='', max_length=150)),
('comment', models.TextField(blank=True, default='')),
('comment', models.CharField(default='', max_length=5000)),
('useful_links', backend.fields.JSONField(default=list)),
('importance_level', models.CharField(choices=[('-', 'normal'), ('+', 'important'), ('++', 'IMPORTANT')], default='-', max_length=2)),
('custom_content', backend.fields.JSONField(default=dict)),
......@@ -87,13 +90,13 @@ class Migration(migrations.Migration):
('obj_moderation_level', models.SmallIntegerField(default=0, validators=[django.core.validators.MinValueValidator(0), backend.models.abstract.my_model.myModel.validate_obj_model_lv])),
('name', models.CharField(max_length=200)),
('iso_alpha2_code', models.CharField(max_length=2, primary_key=True, serialize=False)),
('iso_alpha3_code', models.CharField(max_length=3, unique=True)),
('iso_alpha3_code', models.CharField(default='', max_length=3, unique=True)),
('region_name', models.CharField(max_length=200)),
('region_un_code', models.CharField(max_length=3)),
('sub_region_name', models.CharField(blank=True, max_length=200, null=True)),
('sub_region_un_code', models.CharField(blank=True, max_length=3, null=True)),
('intermediate_region_name', models.CharField(blank=True, max_length=200, null=True)),
('intermediate_region_un_code', models.CharField(blank=True, max_length=3, null=True)),
('sub_region_name', models.CharField(default='', max_length=200)),
('sub_region_un_code', models.CharField(default='', max_length=3)),
('intermediate_region_name', models.CharField(default='', max_length=200)),
('intermediate_region_un_code', models.CharField(default='', max_length=3)),
],
options={
'abstract': False,
......@@ -107,7 +110,7 @@ class Migration(migrations.Migration):
('updated_on', models.DateTimeField(null=True)),
('obj_moderation_level', models.SmallIntegerField(default=0, validators=[django.core.validators.MinValueValidator(0), backend.models.abstract.my_model.myModel.validate_obj_model_lv])),
('title', models.CharField(default='', max_length=150)),
('comment', models.TextField(blank=True, default='')),
('comment', models.CharField(default='', max_length=5000)),
('useful_links', backend.fields.JSONField(default=list)),
('importance_level', models.CharField(choices=[('-', 'normal'), ('+', 'important'), ('++', 'IMPORTANT')], default='-', max_length=2)),
('countries', models.ManyToManyField(related_name='country_dri', to='backend.Country')),
......@@ -124,13 +127,14 @@ class Migration(migrations.Migration):
('updated_on', models.DateTimeField(null=True)),
('obj_moderation_level', models.SmallIntegerField(default=0, validators=[django.core.validators.MinValueValidator(0), backend.models.abstract.my_model.myModel.validate_obj_model_lv])),
('title', models.CharField(default='', max_length=150)),
('comment', models.TextField(blank=True, default='')),
('comment', models.CharField(default='', max_length=5000)),
('useful_links', backend.fields.JSONField(default=list)),
('importance_level', models.CharField(choices=[('-', 'normal'), ('+', 'important'), ('++', 'IMPORTANT')], default='-', max_length=2)),
('type', models.CharField(max_length=200)),
('other_advantages', models.CharField(default='', max_length=5000)),
('frequency', models.CharField(choices=[('w', 'week'), ('m', 'month'), ('s', 'semester'), ('y', 'year'), ('o', 'one_shot')], default='m', max_length=1)),
('amount_min', models.DecimalField(decimal_places=2, max_digits=20, validators=[django.core.validators.MinValueValidator(0)])),
('amount_max', models.DecimalField(decimal_places=2, max_digits=20, validators=[django.core.validators.MinValueValidator(0)])),
('amount_min', models.DecimalField(decimal_places=2, max_digits=20, null=True, validators=[django.core.validators.MinValueValidator(0)])),
('amount_max', models.DecimalField(decimal_places=2, max_digits=20, null=True, validators=[django.core.validators.MinValueValidator(0)])),
('countries', models.ManyToManyField(related_name='country_scholarships', to='backend.Country')),
],
options={
......@@ -145,7 +149,7 @@ class Migration(migrations.Migration):
('updated_on', models.DateTimeField(null=True)),
('obj_moderation_level', models.SmallIntegerField(default=0, validators=[django.core.validators.MinValueValidator(0), backend.models.abstract.my_model.myModel.validate_obj_model_lv])),
('title', models.CharField(default='', max_length=150)),
('comment', models.TextField(blank=True, default='')),
('comment', models.CharField(default='', max_length=5000)),
('useful_links', backend.fields.JSONField(default=list)),
('importance_level', models.CharField(choices=[('-', 'normal'), ('+', 'important'), ('++', 'IMPORTANT')], default='-', max_length=2)),
('custom_content', backend.fields.JSONField(default=dict)),
......@@ -160,7 +164,7 @@ class Migration(migrations.Migration):
('obj_moderation_level', models.SmallIntegerField(default=0, validators=[django.core.validators.MinValueValidator(0), backend.models.abstract.my_model.myModel.validate_obj_model_lv])),
('code', models.CharField(max_length=3, primary_key=True, serialize=False)),
('name', models.CharField(max_length=100)),
('symbol', models.CharField(blank=True, max_length=30, null=True)),
('symbol', models.CharField(default='', max_length=30)),
('one_EUR_in_this_currency', models.DecimalField(decimal_places=6, max_digits=20, validators=[django.core.validators.MinValueValidator(0)])),
],
options={
......@@ -254,8 +258,8 @@ class Migration(migrations.Migration):
('is_anonymous', models.BooleanField(default=True)),
('is_public', models.BooleanField(default=False)),
('courses_and_courses_feedback', backend.fields.JSONField(default=dict)),
('adequation_comment', models.TextField()),
('integration_comment', models.TextField()),
('adequation_comment', models.CharField(default='', max_length=5000)),
('integration_comment', models.CharField(default='', max_length=5000)),
('adequation_grate', models.PositiveIntegerField(validators=[django.core.validators.MaxValueValidator(20)])),
('integration_grade', models.PositiveIntegerField(validators=[django.core.validators.MaxValueValidator(20)])),
('departure', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to='backend.PreviousDeparture')),
......@@ -274,7 +278,7 @@ class Migration(migrations.Migration):
('is_anonymous', models.BooleanField(default=True)),
('is_public', models.BooleanField(default=False)),
('order_in_list', models.PositiveIntegerField()),
('comment', models.TextField(blank=True, null=True)),
('comment', models.CharField(default='', max_length=5000)),
('grade', models.PositiveIntegerField(null=True, validators=[django.core.validators.MaxValueValidator(20)])),
],
),
......@@ -338,9 +342,9 @@ class Migration(migrations.Migration):
('updated_on', models.DateTimeField(null=True)),
('obj_moderation_level', models.SmallIntegerField(default=0, validators=[django.core.validators.MinValueValidator(0), backend.models.abstract.my_model.myModel.validate_obj_model_lv])),
('name', models.CharField(max_length=200)),
('acronym', models.CharField(blank=True, max_length=20, null=True)),
('logo', models.URLField(blank=True, null=True, validators=[backend.models.university.university.validate_extension_django])),
('website', models.URLField(blank=True, max_length=300, null=True)),
('acronym', models.CharField(default='', max_length=20)),
('logo', models.URLField(default='', validators=[backend.models.university.university.validate_extension_django])),
('website', models.URLField(default='', max_length=300)),
('utc_id', models.IntegerField(unique=True)),
],
options={
......@@ -355,7 +359,7 @@ class Migration(migrations.Migration):
('updated_on', models.DateTimeField(null=True)),
('obj_moderation_level', models.SmallIntegerField(default=0, validators=[django.core.validators.MinValueValidator(0), backend.models.abstract.my_model.myModel.validate_obj_model_lv])),
('title', models.CharField(default='', max_length=150)),
('comment', models.TextField(blank=True, default='')),
('comment', models.CharField(default='', max_length=5000)),
('useful_links', backend.fields.JSONField(default=list)),
('importance_level', models.CharField(choices=[('-', 'normal'), ('+', 'important'), ('++', 'IMPORTANT')], default='-', max_length=2)),
],
......@@ -371,14 +375,15 @@ class Migration(migrations.Migration):
('updated_on', models.DateTimeField(null=True)),
('obj_moderation_level', models.SmallIntegerField(default=0, validators=[django.core.validators.MinValueValidator(0), backend.models.abstract.my_model.myModel.validate_obj_model_lv])),
('title', models.CharField(default='', max_length=150)),
('comment', models.TextField(blank=True, default='')),
('comment', models.CharField(default='', max_length=5000)),
('useful_links', backend.fields.JSONField(default=list)),
('importance_level', models.CharField(choices=[('-', 'normal'), ('+', 'important'), ('++', 'IMPORTANT')], default='-', max_length=2)),
('type', models.CharField(max_length=200)),
('other_advantages', models.CharField(default='', max_length=5000)),
('frequency', models.CharField(choices=[('w', 'week'), ('m', 'month'), ('s', 'semester'), ('y', 'year'), ('o', 'one_shot')], default='m', max_length=1)),
('amount_min', models.DecimalField(decimal_places=2, max_digits=20, validators=[django.core.validators.MinValueValidator(0)])),
('amount_max', models.DecimalField(decimal_places=2, max_digits=20, validators=[django.core.validators.MinValueValidator(0)])),
('currency', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='backend.Currency')),
('amount_min', models.DecimalField(decimal_places=2, max_digits=20, null=True, validators=[django.core.validators.MinValueValidator(0)])),
('amount_max', models.DecimalField(decimal_places=2, max_digits=20, null=True, validators=[django.core.validators.MinValueValidator(0)])),
('currency', models.ForeignKey(null=True, on_delete=django.db.models.deletion.PROTECT, to='backend.Currency')),
],
options={
'abstract': False,
......@@ -392,7 +397,7 @@ class Migration(migrations.Migration):
('updated_on', models.DateTimeField(null=True)),
('obj_moderation_level', models.SmallIntegerField(default=0, validators=[django.core.validators.MinValueValidator(0), backend.models.abstract.my_model.myModel.validate_obj_model_lv])),
('title', models.CharField(default='', max_length=150)),
('comment', models.TextField(blank=True, default='')),
('comment', models.CharField(default='', max_length=5000)),
('useful_links', backend.fields.JSONField(default=list)),
('importance_level', models.CharField(choices=[('-', 'normal'), ('+', 'important'), ('++', 'IMPORTANT')], default='-', max_length=2)),
('custom_content', backend.fields.JSONField(default=dict)),
......@@ -421,7 +426,7 @@ class Migration(migrations.Migration):
('updated_on', models.DateTimeField(null=True)),
('obj_moderation_level', models.SmallIntegerField(default=0, validators=[django.core.validators.MinValueValidator(0), backend.models.abstract.my_model.myModel.validate_obj_model_lv])),
('title', models.CharField(default='', max_length=150)),
('comment', models.TextField(blank=True, default='')),
('comment', models.CharField(default='', max_length=5000)),
('useful_links', backend.fields.JSONField(default=list)),
('importance_level', models.CharField(choices=[('-', 'normal'), ('+', 'important'), ('++', 'IMPORTANT')], default='-', max_length=2)),
('university', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, primary_key=True, related_name='university_info', serialize=False, to='backend.University')),
......@@ -439,7 +444,7 @@ class Migration(migrations.Migration):
('updated_on', models.DateTimeField(null=True)),
('obj_moderation_level', models.SmallIntegerField(default=0, validators=[django.core.validators.MinValueValidator(0), backend.models.abstract.my_model.myModel.validate_obj_model_lv])),
('title', models.CharField(default='', max_length=150)),
('comment', models.TextField(blank=True, default='')),
('comment', models.CharField(default='', max_length=5000)),
('useful_links', backend.fields.JSONField(default=list)),
('importance_level', models.CharField(choices=[('-', 'normal'), ('+', 'important'), ('++', 'IMPORTANT')], default='-', max_length=2)),
('university', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, primary_key=True, related_name='university_semesters_dates', serialize=False, to='backend.University')),
......@@ -737,7 +742,7 @@ class Migration(migrations.Migration):
migrations.AddField(
model_name='countryscholarship',
name='currency',
field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='backend.Currency'),
field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.PROTECT, to='backend.Currency'),
),
migrations.AddField(
model_name='countryscholarship',
......
# Generated by Django 2.0.3 on 2018-09-16 09:54
import django.core.validators
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('backend', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='countryscholarship',
name='other_advantages',
field=models.TextField(blank=True, default=''),
),
migrations.AddField(
model_name='universityscholarship',
name='other_advantages',
field=models.TextField(blank=True, default=''),
),
migrations.AlterField(
model_name='countryscholarship',
name='amount_max',
field=models.DecimalField(decimal_places=2, max_digits=20, null=True, validators=[django.core.validators.MinValueValidator(0)]),
),
migrations.AlterField(
model_name='countryscholarship',
name='amount_min',
field=models.DecimalField(decimal_places=2, max_digits=20, null=True, validators=[django.core.validators.MinValueValidator(0)]),
),
migrations.AlterField(
model_name='countryscholarship',
name='currency',
field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.PROTECT, to='backend.Currency'),
),
migrations.AlterField(
model_name='universityscholarship',
name='amount_max',
field=models.DecimalField(decimal_places=2, max_digits=20, null=True, validators=[django.core.validators.MinValueValidator(0)]),
),
migrations.AlterField(
model_name='universityscholarship',
name='amount_min',
field=models.DecimalField(decimal_places=2, max_digits=20, null=True, validators=[django.core.validators.MinValueValidator(0)]),
),
migrations.AlterField(
model_name='universityscholarship',
name='currency',
field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.PROTECT, to='backend.Currency'),
),
]
# Generated by Django 2.0.3 on 2018-09-16 13:55
import backend.models.university.university
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('backend', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='campus',
name='comment',
field=models.CharField(blank=True, default='', max_length=5000),
),
migrations.AlterField(
model_name='campus',
name='name',
field=models.CharField(blank=True, default='', max_length=200),
),
migrations.AlterField(
model_name='campus',
name='title',
field=models.CharField(blank=True, default='', max_length=150),
),
migrations.AlterField(
model_name='campustaggeditem',
name='comment',
field=models.CharField(blank=True, default='', max_length=5000),
),
migrations.AlterField(
model_name='campustaggeditem',
name='title',
field=models.CharField(blank=True, default='', max_length=150),
),
migrations.AlterField(
model_name='city',
name='area',
field=models.CharField(blank=True, default='', max_length=200),
),
migrations.AlterField(
model_name='city',
name='local_name',
field=models.CharField(blank=True, default='', max_length=200),
),
migrations.AlterField(
model_name='citytaggeditem',
name='comment',
field=models.CharField(blank=True, default='', max_length=5000),
),
migrations.AlterField(
model_name='citytaggeditem',
name='title',
field=models.CharField(blank=True, default='', max_length=150),
),
migrations.AlterField(
model_name='country',
name='intermediate_region_name',
field=models.CharField(blank=True, default='', max_length=200),
),
migrations.AlterField(
model_name='country',
name='intermediate_region_un_code',
field=models.CharField(blank=True, default='', max_length=3),
),
migrations.AlterField(
model_name='country',
name='iso_alpha3_code',
field=models.CharField(blank=True, default='', max_length=3, unique=True),
),
migrations.AlterField(
model_name='country',
name='sub_region_name',
field=models.CharField(blank=True, default='', max_length=200),
),
migrations.AlterField(
model_name='country',
name='sub_region_un_code',
field=models.CharField(blank=True, default='', max_length=3),
),
migrations.AlterField(
model_name='countrydri',
name='comment',
field=models.CharField(blank=True, default='', max_length=5000),
),
migrations.AlterField(
model_name='countrydri',
name='title',
field=models.CharField(blank=True, default='', max_length=150),
),
migrations.AlterField(
model_name='countryscholarship',
name='comment',
field=models.CharField(blank=True, default='', max_length=5000),
),
migrations.AlterField(
model_name='countryscholarship',
name='other_advantages',
field=models.CharField(blank=True, default='', max_length=5000),
),
migrations.AlterField(
model_name='countryscholarship',
name='title',
field=models.CharField(blank=True, default='', max_length=150),
),
migrations.AlterField(
model_name='countrytaggeditem',
name='comment',
field=models.CharField(blank=True, default='', max_length=5000),
),
migrations.AlterField(
model_name='countrytaggeditem',
name='title',
field=models.CharField(blank=True, default='', max_length=150),
),
migrations.AlterField(
model_name='currency',
name='symbol',
field=models.CharField(blank=True, default='', max_length=30),
),
migrations.AlterField(
model_name='previousdeparturefeedback',
name='adequation_comment',
field=models.CharField(blank=True, default='', max_length=5000),
),
migrations.AlterField(
model_name='previousdeparturefeedback',
name='integration_comment',
field=models.CharField(blank=True, default='', max_length=5000),
),
migrations.AlterField(
model_name='recommendation',
name='comment',
field=models.CharField(blank=True, default='', max_length=5000),
),
migrations.AlterField(
model_name='university',
name='acronym',
field=models.CharField(blank=True, default='', max_length=20),
),
migrations.AlterField(
model_name='university',
name='logo',
field=models.URLField(blank=True, default='', validators=[backend.models.university.university.validate_extension_django]),
),
migrations.AlterField(
model_name='university',
name='website',
field=models.URLField(blank=True, default='', max_length=300),
),
migrations.AlterField(
model_name='universitydri',
name='comment',
field=models.CharField(blank=True, default='', max_length=5000),
),
migrations.AlterField(
model_name='universitydri',
name='title',
field=models.CharField(blank=True, default='', max_length=150),
),
migrations.AlterField(
model_name='universityinfo',
name='comment',
field=models.CharField(blank=True, default='', max_length=5000),
),
migrations.AlterField(
model_name='universityinfo',
name='title',
field=models.CharField(blank=True, default='', max_length=150),
),
migrations.AlterField(
model_name='universityscholarship',
name='comment',
field=models.CharField(blank=True, default='', max_length=5000),
),
migrations.AlterField(
model_name='universityscholarship',
name='other_advantages',
field=models.CharField(blank=True, default='', max_length=5000),
),
migrations.AlterField(
model_name='universityscholarship',
name='title',
field=models.CharField(blank=True, default='', max_length=150),
),
migrations.AlterField(
model_name='universitysemestersdates',
name='comment',
field=models.CharField(blank=True, default='', max_length=5000),
),
migrations.AlterField(
model_name='universitysemestersdates',
name='title',
field=models.CharField(blank=True, default='', max_length=150),
),
migrations.AlterField(
model_name='universitytaggeditem',
name='comment',
field=models.CharField(blank=True, default='', max_length=5000),
),
migrations.AlterField(
model_name='universitytaggeditem',
name='title',
field=models.CharField(blank=True, default='', max_length=150),
),
]
......@@ -12,8 +12,8 @@ IMPORTANCE_LEVEL = (
class BasicModule(MyModelVersionned):
title = models.CharField(default="", max_length=150)
comment = models.TextField(blank=True, default="")
title = models.CharField(default='', blank=True, max_length=150)
comment = models.CharField(default='', blank=True, max_length=5000)
useful_links = JSONField(default=list)
importance_level = models.CharField(
max_length=2,
......
......@@ -17,7 +17,7 @@ class Scholarship(BasicModule):
type = models.CharField(max_length=200)
currency = models.ForeignKey(Currency, null=True, on_delete=models.PROTECT)
other_advantages = models.TextField(blank=True, default="")
other_advantages = models.CharField(default='', blank=True, max_length=5000)
frequency = models.CharField(
max_length=1,
......
from django.db import models
from backend.models.abstract.my_model import MyModelVersionned, MyModelVersionnedSerializer, MyModelVersionnedViewSet
from backend.models.abstract.basic_module import BasicModule, BasicModuleSerializer, BasicModuleViewSet
from backend.models.city import City
from backend.models.university import University
from django.core.validators import MinValueValidator, MaxValueValidator
from backend.utils import get_model_config, get_viewset_permissions
class Campus(MyModelVersionned):
class Campus(BasicModule):
model_config = get_model_config("Campus")
is_main_campus = models.BooleanField(null=False)
name = models.CharField(max_length=200, null=True)
comment = models.TextField(null=True, blank=True)
name = models.CharField(max_length=200, default='', blank=True)
city = models.ForeignKey(City, on_delete=models.PROTECT, null=False)
university = models.ForeignKey(
University, on_delete=models.PROTECT, null=False, related_name="university_campuses")
......@@ -41,20 +40,20 @@ class Campus(MyModelVersionned):
unique_together = ('is_main_campus', 'university')
class CampusSerializer(MyModelVersionnedSerializer):
class CampusSerializer(BasicModuleSerializer):
class Meta:
model = Campus
fields = '__all__'
class CampusViewSet(MyModelVersionnedViewSet):
class CampusViewSet(BasicModuleViewSet):
permission_classes = get_viewset_permissions("CampusViewSet")
queryset = Campus.objects.all() # pylint: disable=E1101
serializer_class = CampusSerializer
class MainCampusViewSet(MyModelVersionnedViewSet):
class MainCampusViewSet(BasicModuleViewSet):
permission_classes = get_viewset_permissions("MainCampusViewSet")
queryset = Campus.objects.filter(is_main_campus=True)
serializer_class = CampusSerializer
......@@ -8,10 +8,10 @@ class City(MyModel):
model_config = get_model_config("City")
name = models.CharField(max_length=200)
local_name = models.CharField(max_length=200, null=True, blank=True)
local_name = models.CharField(max_length=200, default='', blank=True)
# We add an area to distinguish similarly named cities
# in a country
area = models.CharField(max_length=200, null=True, blank=True)
area = models.CharField(max_length=200, default='', blank=True)
country = models.ForeignKey(Country, on_delete=models.PROTECT)
......
......@@ -10,15 +10,15 @@ class Country(MyModel):
name = models.CharField(max_length=200)
iso_alpha2_code = models.CharField(primary_key=True, max_length=2)
iso_alpha3_code = models.CharField(
unique=True, max_length=3, blank=False, null=False)
unique=True, max_length=3, default='', blank=True)
region_name = models.CharField(max_length=200)
region_un_code = models.CharField(max_length=3)
sub_region_name = models.CharField(max_length=200, null=True, blank=True)
sub_region_un_code = models.CharField(max_length=3, null=True, blank=True)
sub_region_name = models.CharField(max_length=200, default='', blank=True)
sub_region_un_code = models.CharField(max_length=3, default='', blank=True)
intermediate_region_name = models.CharField(
max_length=200, null=True, blank=True)
max_length=200, default='', blank=True)
intermediate_region_un_code = models.CharField(
max_length=3, null=True, blank=True)
max_length=3, default='', blank=True)
class CountrySerializer(MyModelSerializer):
......
......@@ -9,7 +9,7 @@ class Currency(MyModel):
code = models.CharField(primary_key=True, max_length=3)
name = models.CharField(max_length=100)
symbol = models.CharField(null=True, blank=True, max_length=30)
symbol = models.CharField(default='', blank=True, max_length=30)
one_EUR_in_this_currency = models.DecimalField(
max_digits=20,
decimal_places=6,
......
......@@ -24,10 +24,10 @@ class University(MyModel):
model_config = get_model_config("University")
name = models.CharField(max_length=200)
acronym = models.CharField(max_length=20, null=True, blank=True)
logo = models.URLField(null=True, blank=True, validators=[
acronym = models.CharField(max_length=20, default='', blank=True)
logo = models.URLField(default='', blank=True, validators=[
validate_extension_django])
website = models.URLField(null=True, blank=True, max_length=300)
website = models.URLField(default='', blank=True, max_length=300)
utc_id = models.IntegerField(unique=True)
......
......@@ -13,8 +13,8 @@ class PreviousDepartureFeedback(UserRestrictedModule):
PreviousDeparture, on_delete=models.CASCADE)
courses_and_courses_feedback = JSONField(default=dict)
adequation_comment = models.TextField()
integration_comment = models.TextField()
adequation_comment = models.CharField(default='', blank=True, max_length=5000)
integration_comment = models.CharField(default='', blank=True, max_length=5000)
adequation_grate = models.PositiveIntegerField(
validators=[MaxValueValidator(20)])
integration_grade = models.PositiveIntegerField(
......
......@@ -17,7 +17,7 @@ class Recommendation(UserRestrictedModule):
specialty = models.ForeignKey(Specialty, on_delete=models.PROTECT)
order_in_list = models.PositiveIntegerField()
comment = models.TextField(null=True, blank=True)
comment = models.CharField(default='', blank=True, max_length=5000)
grade = models.PositiveIntegerField(
null=True, validators=[MaxValueValidator(20)])
......
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