Commit a938e15d authored by Florent Chehab's avatar Florent Chehab
Browse files

Merge branch 'clean_backend' into 'master'

Clean backend

See merge request chehabfl/outgoing_rex!35
parents 9e62f092 92f591e0
...@@ -7,13 +7,25 @@ class DictModeViewSet(viewsets.ModelViewSet): ...@@ -7,13 +7,25 @@ class DictModeViewSet(viewsets.ModelViewSet):
primary key. Instead of list. primary key. Instead of list.
""" """
BYPASS_DICT_MODE = False BYPASS_DICT_MODE = False
LIST_SHOULD_BE_DETAIL = False
def list(self, request, *args, **kwargs): def list(self, request, *args, **kwargs):
response = super(viewsets.ModelViewSet, self).list( # pylint: disable=E1003 response = super(viewsets.ModelViewSet, self).list( # pylint: disable=E1003
request, *args, **kwargs) # call the original 'list' request, *args, **kwargs) # call the original 'list'
if not self.BYPASS_DICT_MODE:
if self.LIST_SHOULD_BE_DETAIL:
if len(response.data) == 0:
response.data = dict()
elif len(response.data) == 1:
response.data = response.data[0]
else:
raise Exception(
"There should be no more than one element here check your queryset !")
elif not self.BYPASS_DICT_MODE:
pk_attr_name = self.serializer_class.Meta.model._meta.pk.name pk_attr_name = self.serializer_class.Meta.model._meta.pk.name
response.data = { response.data = {
d[pk_attr_name]: d for d in response.data d[pk_attr_name]: d for d in response.data
} }
return response return response
from .DictModeViewSet import DictModeViewSet # noqa: F401 from .DictModeViewSet import DictModeViewSet # noqa: F401
from .jSONField import JSONField # noqa: F401
from .mySerializerWithJSON import MySerializerWithJSON # noqa: F401 from .mySerializerWithJSON import MySerializerWithJSON # noqa: F401
from .jSONField import JSONField from backend.fields.jSONField import JSONField
from rest_framework import serializers from rest_framework import serializers
field_mapping = serializers.ModelSerializer.serializer_field_mapping field_mapping = serializers.ModelSerializer.serializer_field_mapping
......
from .jSONField import JSONField # noqa: F401
# taken from : https://github.com/devkral/django-simple-jsonfield # inspired by : https://github.com/devkral/django-simple-jsonfield
# MIT license
from django.core.exceptions import ValidationError from django.core.exceptions import ValidationError
from django.db import models from django.db import models
......
# Generated by Django 2.0.3 on 2018-09-04 14:38 # Generated by Django 2.0.3 on 2018-09-10 14:19
import backend.models.my_model.myModel import backend.fields.jSONField
import backend.models.tools.jSONField import backend.models.abstract.my_model.myModel
import backend.models.university.university import backend.models.university.university
from django.conf import settings from django.conf import settings
import django.core.validators import django.core.validators
...@@ -14,8 +14,8 @@ class Migration(migrations.Migration): ...@@ -14,8 +14,8 @@ class Migration(migrations.Migration):
initial = True initial = True
dependencies = [ dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('contenttypes', '0002_remove_content_type_name'), ('contenttypes', '0002_remove_content_type_name'),
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
] ]
operations = [ operations = [
...@@ -25,8 +25,9 @@ class Migration(migrations.Migration): ...@@ -25,8 +25,9 @@ class Migration(migrations.Migration):
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('moderated_on', models.DateTimeField(null=True)), ('moderated_on', models.DateTimeField(null=True)),
('updated_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.my_model.myModel.validate_obj_model_lv])), ('obj_moderation_level', models.SmallIntegerField(default=0, validators=[django.core.validators.MinValueValidator(0), backend.models.abstract.my_model.myModel.validate_obj_model_lv])),
('usefull_links', backend.models.tools.jSONField.JSONField(default=list)), ('usefull_links', backend.fields.jSONField.JSONField(default=list)),
('importance_level', models.CharField(choices=[('-', 'normal'), ('+', 'important'), ('++', 'IMPORTANT')], default='-', max_length=2)),
('is_main_campus', models.BooleanField()), ('is_main_campus', models.BooleanField()),
('name', models.CharField(max_length=200, null=True)), ('name', models.CharField(max_length=200, null=True)),
('comment', models.TextField(blank=True, null=True)), ('comment', models.TextField(blank=True, null=True)),
...@@ -34,13 +35,28 @@ class Migration(migrations.Migration): ...@@ -34,13 +35,28 @@ class Migration(migrations.Migration):
('lon', models.DecimalField(decimal_places=6, max_digits=10, validators=[django.core.validators.MinValueValidator(-180), django.core.validators.MaxValueValidator(180)])), ('lon', models.DecimalField(decimal_places=6, max_digits=10, validators=[django.core.validators.MinValueValidator(-180), django.core.validators.MaxValueValidator(180)])),
], ],
), ),
migrations.CreateModel(
name='CampusTaggedItem',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('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])),
('comment', models.TextField(blank=True)),
('usefull_links', backend.fields.jSONField.JSONField(default=list)),
('importance_level', models.CharField(choices=[('-', 'normal'), ('+', 'important'), ('++', 'IMPORTANT')], default='-', max_length=2)),
('custom_content', backend.fields.jSONField.JSONField(default=dict)),
('campus', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='campus_tagged_items', to='backend.Campus')),
('moderated_by', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to=settings.AUTH_USER_MODEL)),
],
),
migrations.CreateModel( migrations.CreateModel(
name='City', name='City',
fields=[ fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('moderated_on', models.DateTimeField(null=True)), ('moderated_on', models.DateTimeField(null=True)),
('updated_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.my_model.myModel.validate_obj_model_lv])), ('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)), ('name', models.CharField(max_length=200)),
('local_name', models.CharField(blank=True, max_length=200, null=True)), ('local_name', models.CharField(blank=True, max_length=200, null=True)),
('area', models.CharField(blank=True, max_length=200, null=True)), ('area', models.CharField(blank=True, max_length=200, null=True)),
...@@ -49,12 +65,27 @@ class Migration(migrations.Migration): ...@@ -49,12 +65,27 @@ class Migration(migrations.Migration):
'abstract': False, 'abstract': False,
}, },
), ),
migrations.CreateModel(
name='CityTaggedItem',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('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])),
('comment', models.TextField(blank=True)),
('usefull_links', backend.fields.jSONField.JSONField(default=list)),
('importance_level', models.CharField(choices=[('-', 'normal'), ('+', 'important'), ('++', 'IMPORTANT')], default='-', max_length=2)),
('custom_content', backend.fields.jSONField.JSONField(default=dict)),
('city', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='city_tagged_items', to='backend.City')),
('moderated_by', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to=settings.AUTH_USER_MODEL)),
],
),
migrations.CreateModel( migrations.CreateModel(
name='Country', name='Country',
fields=[ fields=[
('moderated_on', models.DateTimeField(null=True)), ('moderated_on', models.DateTimeField(null=True)),
('updated_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.my_model.myModel.validate_obj_model_lv])), ('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)), ('name', models.CharField(max_length=200)),
('iso_alpha2_code', models.CharField(max_length=2, primary_key=True, serialize=False)), ('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(max_length=3, unique=True)),
...@@ -64,6 +95,8 @@ class Migration(migrations.Migration): ...@@ -64,6 +95,8 @@ class Migration(migrations.Migration):
('sub_region_un_code', models.CharField(blank=True, max_length=3, 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_name', models.CharField(blank=True, max_length=200, null=True)),
('intermediate_region_un_code', models.CharField(blank=True, max_length=3, null=True)), ('intermediate_region_un_code', models.CharField(blank=True, max_length=3, null=True)),
('moderated_by', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to=settings.AUTH_USER_MODEL)),
('updated_by', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to=settings.AUTH_USER_MODEL)),
], ],
options={ options={
'abstract': False, 'abstract': False,
...@@ -75,9 +108,13 @@ class Migration(migrations.Migration): ...@@ -75,9 +108,13 @@ class Migration(migrations.Migration):
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('moderated_on', models.DateTimeField(null=True)), ('moderated_on', models.DateTimeField(null=True)),
('updated_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.my_model.myModel.validate_obj_model_lv])), ('obj_moderation_level', models.SmallIntegerField(default=0, validators=[django.core.validators.MinValueValidator(0), backend.models.abstract.my_model.myModel.validate_obj_model_lv])),
('comment', models.TextField(blank=True)), ('comment', models.TextField(blank=True)),
('usefull_links', backend.models.tools.jSONField.JSONField(default=list)), ('usefull_links', backend.fields.jSONField.JSONField(default=list)),
('importance_level', models.CharField(choices=[('-', 'normal'), ('+', 'important'), ('++', 'IMPORTANT')], default='-', max_length=2)),
('country', models.ManyToManyField(related_name='country_dri', to='backend.Country')),
('moderated_by', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to=settings.AUTH_USER_MODEL)),
('updated_by', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to=settings.AUTH_USER_MODEL)),
], ],
options={ options={
'abstract': False, 'abstract': False,
...@@ -89,23 +126,40 @@ class Migration(migrations.Migration): ...@@ -89,23 +126,40 @@ class Migration(migrations.Migration):
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('moderated_on', models.DateTimeField(null=True)), ('moderated_on', models.DateTimeField(null=True)),
('updated_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.my_model.myModel.validate_obj_model_lv])), ('obj_moderation_level', models.SmallIntegerField(default=0, validators=[django.core.validators.MinValueValidator(0), backend.models.abstract.my_model.myModel.validate_obj_model_lv])),
('comment', models.TextField(blank=True)), ('comment', models.TextField(blank=True)),
('usefull_links', backend.models.tools.jSONField.JSONField(default=list)), ('usefull_links', backend.fields.jSONField.JSONField(default=list)),
('importance_level', models.CharField(choices=[('-', 'normal'), ('+', 'important'), ('++', 'IMPORTANT')], default='-', max_length=2)),
('type', models.CharField(max_length=200)), ('type', models.CharField(max_length=200)),
('amount_min', models.DecimalField(decimal_places=2, max_digits=20, validators=[django.core.validators.MinValueValidator(0)])), ('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_max', models.DecimalField(decimal_places=2, max_digits=20, validators=[django.core.validators.MinValueValidator(0)])),
('country', models.ManyToManyField(related_name='country_scholarships', to='backend.Country')),
], ],
options={ options={
'abstract': False, 'abstract': False,
}, },
), ),
migrations.CreateModel(
name='CountryTaggedItem',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('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])),
('comment', models.TextField(blank=True)),
('usefull_links', backend.fields.jSONField.JSONField(default=list)),
('importance_level', models.CharField(choices=[('-', 'normal'), ('+', 'important'), ('++', 'IMPORTANT')], default='-', max_length=2)),
('custom_content', backend.fields.jSONField.JSONField(default=dict)),
('country', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='country_tagged_items', to='backend.Country')),
('moderated_by', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to=settings.AUTH_USER_MODEL)),
],
),
migrations.CreateModel( migrations.CreateModel(
name='Currency', name='Currency',
fields=[ fields=[
('moderated_on', models.DateTimeField(null=True)), ('moderated_on', models.DateTimeField(null=True)),
('updated_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.my_model.myModel.validate_obj_model_lv])), ('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)), ('code', models.CharField(max_length=3, primary_key=True, serialize=False)),
('name', models.CharField(max_length=100)), ('name', models.CharField(max_length=100)),
('symbol', models.CharField(blank=True, max_length=30, null=True)), ('symbol', models.CharField(blank=True, max_length=30, null=True)),
...@@ -122,7 +176,7 @@ class Migration(migrations.Migration): ...@@ -122,7 +176,7 @@ class Migration(migrations.Migration):
fields=[ fields=[
('moderated_on', models.DateTimeField(null=True)), ('moderated_on', models.DateTimeField(null=True)),
('updated_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.my_model.myModel.validate_obj_model_lv])), ('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=6, primary_key=True, serialize=False)), ('code', models.CharField(max_length=6, primary_key=True, serialize=False)),
('name', models.CharField(max_length=100)), ('name', models.CharField(max_length=100)),
('active', models.BooleanField()), ('active', models.BooleanField()),
...@@ -139,7 +193,7 @@ class Migration(migrations.Migration): ...@@ -139,7 +193,7 @@ class Migration(migrations.Migration):
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('moderated_on', models.DateTimeField(null=True)), ('moderated_on', models.DateTimeField(null=True)),
('updated_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.my_model.myModel.validate_obj_model_lv])), ('obj_moderation_level', models.SmallIntegerField(default=0, validators=[django.core.validators.MinValueValidator(0), backend.models.abstract.my_model.myModel.validate_obj_model_lv])),
('aaa', models.CharField(max_length=100)), ('aaa', models.CharField(max_length=100)),
('moderated_by', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to=settings.AUTH_USER_MODEL)), ('moderated_by', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to=settings.AUTH_USER_MODEL)),
('updated_by', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to=settings.AUTH_USER_MODEL)), ('updated_by', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to=settings.AUTH_USER_MODEL)),
...@@ -154,7 +208,7 @@ class Migration(migrations.Migration): ...@@ -154,7 +208,7 @@ class Migration(migrations.Migration):
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('moderated_on', models.DateTimeField(null=True)), ('moderated_on', models.DateTimeField(null=True)),
('updated_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.my_model.myModel.validate_obj_model_lv])), ('obj_moderation_level', models.SmallIntegerField(default=0, validators=[django.core.validators.MinValueValidator(0), backend.models.abstract.my_model.myModel.validate_obj_model_lv])),
('bbb', models.CharField(max_length=100)), ('bbb', models.CharField(max_length=100)),
('moderated_by', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to=settings.AUTH_USER_MODEL)), ('moderated_by', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to=settings.AUTH_USER_MODEL)),
('updated_by', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to=settings.AUTH_USER_MODEL)), ('updated_by', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to=settings.AUTH_USER_MODEL)),
...@@ -169,7 +223,7 @@ class Migration(migrations.Migration): ...@@ -169,7 +223,7 @@ class Migration(migrations.Migration):
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('moderated_on', models.DateTimeField(null=True)), ('moderated_on', models.DateTimeField(null=True)),
('updated_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.my_model.myModel.validate_obj_model_lv])), ('obj_moderation_level', models.SmallIntegerField(default=0, validators=[django.core.validators.MinValueValidator(0), backend.models.abstract.my_model.myModel.validate_obj_model_lv])),
('nb_seats_offered', models.PositiveIntegerField()), ('nb_seats_offered', models.PositiveIntegerField()),
('nb_seats_offered_exchange', models.PositiveIntegerField(null=True)), ('nb_seats_offered_exchange', models.PositiveIntegerField(null=True)),
('nb_seats_offered_double_degree', models.PositiveIntegerField(null=True)), ('nb_seats_offered_double_degree', models.PositiveIntegerField(null=True)),
...@@ -182,7 +236,7 @@ class Migration(migrations.Migration): ...@@ -182,7 +236,7 @@ class Migration(migrations.Migration):
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('object_id', models.CharField(max_length=100)), ('object_id', models.CharField(max_length=100)),
('updated_on', models.DateTimeField(null=True)), ('updated_on', models.DateTimeField(null=True)),
('new_object', backend.models.tools.jSONField.JSONField(default=dict)), ('new_object', backend.fields.jSONField.JSONField(default=dict)),
('content_type', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='contenttypes.ContentType')), ('content_type', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='contenttypes.ContentType')),
('updated_by', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)), ('updated_by', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
], ],
...@@ -193,10 +247,10 @@ class Migration(migrations.Migration): ...@@ -193,10 +247,10 @@ class Migration(migrations.Migration):
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('moderated_on', models.DateTimeField(null=True)), ('moderated_on', models.DateTimeField(null=True)),
('updated_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.my_model.myModel.validate_obj_model_lv])), ('obj_moderation_level', models.SmallIntegerField(default=0, validators=[django.core.validators.MinValueValidator(0), backend.models.abstract.my_model.myModel.validate_obj_model_lv])),
('Utc_departure_id', models.IntegerField()), ('Utc_departure_id', models.IntegerField()),
('is_anonymous', models.BooleanField()), ('is_anonymous', models.BooleanField()),
('courses', backend.models.tools.jSONField.JSONField(null=True)), ('courses', backend.fields.jSONField.JSONField(null=True)),
('moderated_by', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to=settings.AUTH_USER_MODEL)), ('moderated_by', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to=settings.AUTH_USER_MODEL)),
], ],
options={ options={
...@@ -209,10 +263,10 @@ class Migration(migrations.Migration): ...@@ -209,10 +263,10 @@ class Migration(migrations.Migration):
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('moderated_on', models.DateTimeField(null=True)), ('moderated_on', models.DateTimeField(null=True)),
('updated_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.my_model.myModel.validate_obj_model_lv])), ('obj_moderation_level', models.SmallIntegerField(default=0, validators=[django.core.validators.MinValueValidator(0), backend.models.abstract.my_model.myModel.validate_obj_model_lv])),
('is_anonymous', models.BooleanField(default=True)), ('is_anonymous', models.BooleanField(default=True)),
('is_public', models.BooleanField(default=False)), ('is_public', models.BooleanField(default=False)),
('courses_and_courses_feedback', backend.models.tools.jSONField.JSONField(default=dict)), ('courses_and_courses_feedback', backend.fields.jSONField.JSONField(default=dict)),
('adequation_comment', models.TextField()), ('adequation_comment', models.TextField()),
('integration_comment', models.TextField()), ('integration_comment', models.TextField()),
('adequation_grate', models.PositiveIntegerField(validators=[django.core.validators.MaxValueValidator(20)])), ('adequation_grate', models.PositiveIntegerField(validators=[django.core.validators.MaxValueValidator(20)])),
...@@ -232,7 +286,7 @@ class Migration(migrations.Migration): ...@@ -232,7 +286,7 @@ class Migration(migrations.Migration):
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('moderated_on', models.DateTimeField(null=True)), ('moderated_on', models.DateTimeField(null=True)),
('updated_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.my_model.myModel.validate_obj_model_lv])), ('obj_moderation_level', models.SmallIntegerField(default=0, validators=[django.core.validators.MinValueValidator(0), backend.models.abstract.my_model.myModel.validate_obj_model_lv])),
('is_anonymous', models.BooleanField(default=True)), ('is_anonymous', models.BooleanField(default=True)),
('is_public', models.BooleanField(default=False)), ('is_public', models.BooleanField(default=False)),
('order_in_list', models.PositiveIntegerField()), ('order_in_list', models.PositiveIntegerField()),
...@@ -248,7 +302,7 @@ class Migration(migrations.Migration): ...@@ -248,7 +302,7 @@ class Migration(migrations.Migration):
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('moderated_on', models.DateTimeField(null=True)), ('moderated_on', models.DateTimeField(null=True)),
('updated_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.my_model.myModel.validate_obj_model_lv])), ('obj_moderation_level', models.SmallIntegerField(default=0, validators=[django.core.validators.MinValueValidator(0), backend.models.abstract.my_model.myModel.validate_obj_model_lv])),
('is_anonymous', models.BooleanField(default=True)), ('is_anonymous', models.BooleanField(default=True)),
('is_public', models.BooleanField(default=False)), ('is_public', models.BooleanField(default=False)),
('public', models.BooleanField()), ('public', models.BooleanField()),
...@@ -263,7 +317,7 @@ class Migration(migrations.Migration): ...@@ -263,7 +317,7 @@ class Migration(migrations.Migration):
fields=[ fields=[
('moderated_on', models.DateTimeField(null=True)), ('moderated_on', models.DateTimeField(null=True)),
('updated_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.my_model.myModel.validate_obj_model_lv])), ('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=6, primary_key=True, serialize=False)), ('code', models.CharField(max_length=6, primary_key=True, serialize=False)),
('moderated_by', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to=settings.AUTH_USER_MODEL)), ('moderated_by', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to=settings.AUTH_USER_MODEL)),
('updated_by', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to=settings.AUTH_USER_MODEL)), ('updated_by', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to=settings.AUTH_USER_MODEL)),
...@@ -278,7 +332,7 @@ class Migration(migrations.Migration): ...@@ -278,7 +332,7 @@ class Migration(migrations.Migration):
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('moderated_on', models.DateTimeField(null=True)), ('moderated_on', models.DateTimeField(null=True)),
('updated_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.my_model.myModel.validate_obj_model_lv])), ('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=6)), ('code', models.CharField(max_length=6)),
('name', models.CharField(max_length=100)), ('name', models.CharField(max_length=100)),
('active', models.BooleanField()), ('active', models.BooleanField()),
...@@ -293,9 +347,9 @@ class Migration(migrations.Migration): ...@@ -293,9 +347,9 @@ class Migration(migrations.Migration):
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('moderated_on', models.DateTimeField(null=True)), ('moderated_on', models.DateTimeField(null=True)),
('updated_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.my_model.myModel.validate_obj_model_lv])), ('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=100, unique=True)), ('name', models.CharField(max_length=100, unique=True)),
('config', backend.models.tools.jSONField.JSONField(default=dict)), ('config', backend.fields.jSONField.JSONField(default=dict)),
('moderated_by', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to=settings.AUTH_USER_MODEL)), ('moderated_by', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to=settings.AUTH_USER_MODEL)),
('updated_by', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to=settings.AUTH_USER_MODEL)), ('updated_by', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to=settings.AUTH_USER_MODEL)),
], ],
...@@ -309,7 +363,7 @@ class Migration(migrations.Migration): ...@@ -309,7 +363,7 @@ class Migration(migrations.Migration):
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('moderated_on', models.DateTimeField(null=True)), ('moderated_on', models.DateTimeField(null=True)),
('updated_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.my_model.myModel.validate_obj_model_lv])), ('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)), ('name', models.CharField(max_length=200)),
('acronym', models.CharField(blank=True, max_length=20, null=True)), ('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])), ('logo', models.URLField(blank=True, null=True, validators=[backend.models.university.university.validate_extension_django])),
...@@ -326,9 +380,10 @@ class Migration(migrations.Migration): ...@@ -326,9 +380,10 @@ class Migration(migrations.Migration):
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('moderated_on', models.DateTimeField(null=True)), ('moderated_on', models.DateTimeField(null=True)),
('updated_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.my_model.myModel.validate_obj_model_lv])), ('obj_moderation_level', models.SmallIntegerField(default=0, validators=[django.core.validators.MinValueValidator(0), backend.models.abstract.my_model.myModel.validate_obj_model_lv])),
('comment', models.TextField(blank=True)), ('comment', models.TextField(blank=True)),
('usefull_links', backend.models.tools.jSONField.JSONField(default=list)), ('usefull_links', backend.fields.jSONField.JSONField(default=list)),
('importance_level', models.CharField(choices=[('-', 'normal'), ('+', 'important'), ('++', 'IMPORTANT')], default='-', max_length=2)),
('moderated_by', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to=settings.AUTH_USER_MODEL)), ('moderated_by', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to=settings.AUTH_USER_MODEL)),
], ],
options={ options={
...@@ -341,9 +396,10 @@ class Migration(migrations.Migration): ...@@ -341,9 +396,10 @@ class Migration(migrations.Migration):
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('moderated_on', models.DateTimeField(null=True)), ('moderated_on', models.DateTimeField(null=True)),
('updated_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.my_model.myModel.validate_obj_model_lv])), ('obj_moderation_level', models.SmallIntegerField(default=0, validators=[django.core.validators.MinValueValidator(0), backend.models.abstract.my_model.myModel.validate_obj_model_lv])),
('comment', models.TextField(blank=True)), ('comment', models.TextField(blank=True)),
('usefull_links', backend.models.tools.jSONField.JSONField(default=list)), ('usefull_links', backend.fields.jSONField.JSONField(default=list)),
('importance_level', models.CharField(choices=[('-', 'normal'), ('+', 'important'), ('++', 'IMPORTANT')], default='-', max_length=2)),
('type', models.CharField(max_length=200)), ('type', models.CharField(max_length=200)),
('amount_min', models.DecimalField(decimal_places=2, max_digits=20, validators=[django.core.validators.MinValueValidator(0)])), ('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_max', models.DecimalField(decimal_places=2, max_digits=20, validators=[django.core.validators.MinValueValidator(0)])),
...@@ -355,68 +411,45 @@ class Migration(migrations.Migration): ...@@ -355,68 +411,45 @@ class Migration(migrations.Migration):
}, },
), ),
migrations.CreateModel( migrations.CreateModel(
name='UserData', name='UniversityTaggedItem',
fields=[ fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),