Commit 04c716cf authored by Florent Chehab's avatar Florent Chehab
Browse files

Merge branch 'update_back_linting' into 'master'

Update back linting and fix documentation job failing on master

Closes #44

See merge request !44
parents 3a3bbbd2 955238be
Pipeline #34792 passed with stages
in 2 minutes and 57 seconds
......@@ -14,19 +14,18 @@ from datetime import datetime
class LoadUniversityEx(LoadGeneric):
def __init__(self, admin):
self.admin = admin
def load(self):
EPFL = University.objects.get(acronym='EPFL')
CHF = Currency.objects.get(pk='CHF')
ACCOMMODATION_TAG = Tag.objects.get(name='accommodation')
EPFL = University.objects.get(acronym="EPFL")
CHF = Currency.objects.get(pk="CHF")
ACCOMMODATION_TAG = Tag.objects.get(name="accommodation")
SWITZERLAND = Country.objects.get(pk="CH")
univ_dri_1 = UniversityDri(
title="Cours en anglais",
importance_level='+',
importance_level="+",
comment="Les cours de master en computer science sont 100% en anglais",
)
univ_dri_1.save()
......@@ -38,13 +37,14 @@ class LoadUniversityEx(LoadGeneric):
univ_info.costs_currency = CHF
self.add_info_and_save(univ_info, self.admin)
usd = UniversitySemestersDates.objects.get(
university=EPFL)
usd.autumn_begin = datetime.strptime("17/09/2018", '%d/%m/%Y')
usd.autumn_end = datetime.strptime("29/01/2019", '%d/%m/%Y')
usd = UniversitySemestersDates.objects.get(university=EPFL)
usd.autumn_begin = datetime.strptime("17/09/2018", "%d/%m/%Y")
usd.autumn_end = datetime.strptime("29/01/2019", "%d/%m/%Y")
usd.useful_links = [
{"url": "https://memento.epfl.ch/academic-calendar",
"description": "Site de l'EPFL"}
{
"url": "https://memento.epfl.ch/academic-calendar",
"description": "Site de l'EPFL",
}
]
self.add_info_and_save(usd, self.admin)
......@@ -52,10 +52,10 @@ class LoadUniversityEx(LoadGeneric):
title="Swiss European Mobility Programme",
type="Bourse du gouvernement suisse",
currency=CHF,
frequency='s',
frequency="s",
amount_min=2200,
amount_max=2200,
comment="Bourse attribuée de manière automatique."
comment="Bourse attribuée de manière automatique.",
)
country_scholarship.save()
country_scholarship.countries.add(SWITZERLAND)
......@@ -66,6 +66,6 @@ class LoadUniversityEx(LoadGeneric):
tag=ACCOMMODATION_TAG,
title="C'est compliqué de trouver un logement",
comment="Mon commentaire.",
importance_level='++'
importance_level="++",
)
self.add_info_and_save(univ_tag_1, self.admin)
......@@ -14,884 +14,1959 @@ class Migration(migrations.Migration):
initial = True
dependencies = [
('auth', '0009_alter_user_last_name_max_length'),
('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),
]
operations = [
migrations.CreateModel(
name='Campus',
name="Campus",
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_app.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_app.fields.JSONField(default=list)),
('importance_level', models.CharField(choices=[('-', 'normal'), ('+', 'important'), ('++', 'IMPORTANT')], default='-', max_length=2)),
('is_main_campus', models.BooleanField()),
('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)])),
(
"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_app.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_app.fields.JSONField(default=list)),
(
"importance_level",
models.CharField(
choices=[
("-", "normal"),
("+", "important"),
("++", "IMPORTANT"),
],
default="-",
max_length=2,
),
),
("is_main_campus", models.BooleanField()),
("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),
],
),
),
],
),
migrations.CreateModel(
name='CampusTaggedItem',
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_app.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_app.fields.JSONField(default=list)),
('importance_level', models.CharField(choices=[('-', 'normal'), ('+', 'important'), ('++', 'IMPORTANT')], default='-', max_length=2)),
('custom_content', backend_app.fields.JSONField(default=dict)),
('campus', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='campus_tagged_items', to='backend_app.Campus')),
(
"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_app.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_app.fields.JSONField(default=list)),
(
"importance_level",
models.CharField(
choices=[
("-", "normal"),
("+", "important"),
("++", "IMPORTANT"),
],
default="-",
max_length=2,
),
),
("custom_content", backend_app.fields.JSONField(default=dict)),
(
"campus",
models.ForeignKey(
on_delete=django.db.models.deletion.PROTECT,
related_name="campus_tagged_items",
to="backend_app.Campus",
),
),
],
),
migrations.CreateModel(
name='City',
name="City",
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_app.models.abstract.my_model.myModel.validate_obj_model_lv])),
('name', models.CharField(max_length=200)),
('local_name', models.CharField(default='', max_length=200)),
('area', models.CharField(default='', max_length=200)),
(
"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_app.models.abstract.my_model.myModel.validate_obj_model_lv,
],
),
),
("name", models.CharField(max_length=200)),
("local_name", models.CharField(default="", max_length=200)),
("area", models.CharField(default="", max_length=200)),
],
options={
'abstract': False,
},
options={"abstract": False},
),
migrations.CreateModel(
name='CityTaggedItem',
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_app.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_app.fields.JSONField(default=list)),
('importance_level', models.CharField(choices=[('-', 'normal'), ('+', 'important'), ('++', 'IMPORTANT')], default='-', max_length=2)),
('custom_content', backend_app.fields.JSONField(default=dict)),
('city', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='city_tagged_items', to='backend_app.City')),
(
"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_app.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_app.fields.JSONField(default=list)),
(
"importance_level",
models.CharField(
choices=[
("-", "normal"),
("+", "important"),
("++", "IMPORTANT"),
],
default="-",
max_length=2,
),
),
("custom_content", backend_app.fields.JSONField(default=dict)),
(
"city",
models.ForeignKey(
on_delete=django.db.models.deletion.PROTECT,
related_name="city_tagged_items",
to="backend_app.City",
),
),
],
),
migrations.CreateModel(
name='Country',
name="Country",
fields=[
('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_app.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(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(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)),
("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_app.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(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(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,
},
options={"abstract": False},
),
migrations.CreateModel(
name='CountryDri',
name="CountryDri",
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_app.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_app.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_app.Country')),
(
"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_app.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_app.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_app.Country"
),
),
],
options={
'abstract': False,
},
options={"abstract": False},
),
migrations.CreateModel(
name='CountryScholarship',
name="CountryScholarship",
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_app.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_app.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, 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_app.Country')),
(
"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_app.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_app.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,
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_app.Country"
),
),
],
options={
'abstract': False,
},
options={"abstract": False},
),
migrations.CreateModel(
name='CountryTaggedItem',
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_app.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_app.fields.JSONField(default=list)),
('importance_level', models.CharField(choices=[('-', 'normal'), ('+', 'important'), ('++', 'IMPORTANT')], default='-', max_length=2)),
('custom_content', backend_app.fields.JSONField(default=dict)),
('country', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='country_tagged_items', to='backend_app.Country')),
(
"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",