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

Merge branch 'app_renamed' into 'master'

App renamed from rex to backend to be clearer

See merge request chehabfl/outgoing_rex!12
parents 55e35f6d 99f8d783
from django.contrib import admin
from reversion_compare.admin import CompareVersionAdmin
from rex.models.location import Country, City
from backend.models.location import Country, City
from rex.models.location import CountryCulture
from rex.models.location import CountryHealthInsurance
from rex.models.location import CountryOtherInsurance
from rex.models.location import CountryTransport
from rex.models.location import CountryTourism
from rex.models.location import CountryOtherStuff
from rex.models.location import CountryVisaAdministrative
from rex.models.location import CountryPhoto
from rex.models.location import CountryScholarship
from rex.models.location import CountryDri
from backend.models.location import CountryCulture
from backend.models.location import CountryHealthInsurance
from backend.models.location import CountryOtherInsurance
from backend.models.location import CountryTransport
from backend.models.location import CountryTourism
from backend.models.location import CountryOtherStuff
from backend.models.location import CountryVisaAdministrative
from backend.models.location import CountryPhoto
from backend.models.location import CountryScholarship
from backend.models.location import CountryDri
from rex.models.location import CityTransport
from rex.models.location import CityTourism
from rex.models.location import CityOtherStuff
from backend.models.location import CityTransport
from backend.models.location import CityTourism
from backend.models.location import CityOtherStuff
from rex.models.university import University, Campus, UniversityScholarship
from backend.models.university import University, Campus, UniversityScholarship
from rex.models.university import UniversityInfo
from rex.models.university import UniversitySemestersDates
from rex.models.university import UniversityInsurance
from rex.models.university import UniversityCourses
from rex.models.university import UniversityCulture
from rex.models.university import UniversityOtherStuff
from rex.models.university import UniversitySpecialOffer
from rex.models.university import UniversityPhoto
from rex.models.university import UniversityDri
from backend.models.university import UniversityInfo
from backend.models.university import UniversitySemestersDates
from backend.models.university import UniversityInsurance
from backend.models.university import UniversityCourses
from backend.models.university import UniversityCulture
from backend.models.university import UniversityOtherStuff
from backend.models.university import UniversitySpecialOffer
from backend.models.university import UniversityPhoto
from backend.models.university import UniversityDri
from rex.models.university import CampusTransport
from rex.models.university import CampusAccommodation
from rex.models.university import CampusCultureAndStudentLife
from rex.models.university import CampusOtherStuff
from backend.models.university import CampusTransport
from backend.models.university import CampusAccommodation
from backend.models.university import CampusCultureAndStudentLife
from backend.models.university import CampusOtherStuff
from rex.models.module import Currency
from rex.models.otherCore import Department
from rex.models.otherCore import Offer
from rex.models.otherCore import Semester
from rex.models.otherCore import Specialty
from backend.models.module import Currency
from backend.models.otherCore import Department
from backend.models.otherCore import Offer
from backend.models.otherCore import Semester
from backend.models.otherCore import Specialty
from rex.models.user import Recommendation
from rex.models.user import RecommendationList
from rex.models.user import PreviousDeparture
from rex.models.user import PreviousDepartureFeedback
from rex.models.user import UserData
from backend.models.user import Recommendation
from backend.models.user import RecommendationList
from backend.models.user import PreviousDeparture
from backend.models.user import PreviousDepartureFeedback
from backend.models.user import UserData
CLASSIC_MODELS = [
Country,
......
from django.apps import AppConfig
class RexConfig(AppConfig):
name = 'rex'
class BackendConfig(AppConfig):
name = 'backend'
# Generated by Django 2.0.3 on 2018-08-22 08:13
import backend.models.tools.usefullLinksField
import backend.utils.friendly_path
from django.conf import settings
import django.contrib.postgres.fields.jsonb
import django.core.validators
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operations = [
migrations.CreateModel(
name='Campus',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('usefull_links', backend.models.tools.usefullLinksField.UsefullLinksField(blank=True, default=[], validators=[backend.models.tools.usefullLinksField.validate_usefull_links])),
('is_main_campus', models.BooleanField()),
('name', models.CharField(max_length=200, null=True)),
('comment', models.TextField(blank=True, null=True)),
('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='City',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('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)),
],
),
migrations.CreateModel(
name='CityPhoto',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('photo', models.ImageField(default='path/to/my/default/image.jpg', max_length=250, upload_to=backend.utils.friendly_path.friendly_path('uploads/universities/photos/', 'title'))),
('title', models.CharField(max_length=200)),
('description', models.TextField(blank=True, null=True)),
],
),
migrations.CreateModel(
name='Country',
fields=[
('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)),
('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)),
],
),
migrations.CreateModel(
name='CountryDri',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('comment', models.TextField(blank=True)),
('usefull_links', backend.models.tools.usefullLinksField.UsefullLinksField(blank=True, default=[], validators=[backend.models.tools.usefullLinksField.validate_usefull_links])),
],
options={
'abstract': False,
},
),
migrations.CreateModel(
name='CountryPhoto',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('photo', models.ImageField(default='path/to/my/default/image.jpg', max_length=250, upload_to=backend.utils.friendly_path.friendly_path('uploads/universities/photos/', 'title'))),
('title', models.CharField(max_length=200)),
('description', models.TextField(blank=True, null=True)),
],
),
migrations.CreateModel(
name='CountryScholarship',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('comment', models.TextField(blank=True)),
('usefull_links', backend.models.tools.usefullLinksField.UsefullLinksField(blank=True, default=[], validators=[backend.models.tools.usefullLinksField.validate_usefull_links])),
('type', models.CharField(max_length=200)),
('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)])),
],
options={
'abstract': False,
},
),
migrations.CreateModel(
name='Currency',
fields=[
('code', models.CharField(max_length=15, primary_key=True, serialize=False)),
('name', models.CharField(max_length=100)),
('symbol', models.CharField(max_length=5)),
('one_USD_in_this_currency', models.DecimalField(decimal_places=6, max_digits=20, validators=[django.core.validators.MinValueValidator(0)])),
],
),
migrations.CreateModel(
name='Department',
fields=[
('code', models.CharField(max_length=6, primary_key=True, serialize=False)),
('name', models.CharField(max_length=100)),
('active', models.BooleanField()),
],
),
migrations.CreateModel(
name='Offer',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('nb_seats_offered', models.PositiveIntegerField()),
('nb_seats_offered_exchange', models.PositiveIntegerField(null=True)),
('nb_seats_offered_double_degree', models.PositiveIntegerField(null=True)),
],
),
migrations.CreateModel(
name='PreviousDeparture',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('Utc_departure_id', models.IntegerField()),
('is_anonymous', models.BooleanField()),
('courses', django.contrib.postgres.fields.jsonb.JSONField(null=True)),
],
),
migrations.CreateModel(
name='PreviousDepartureFeedback',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('is_anonymous', models.BooleanField(default=True)),
('is_public', models.BooleanField(default=False)),
('courses_and_courses_feedback', django.contrib.postgres.fields.jsonb.JSONField(null=True)),
('adequation_comment', models.TextField()),
('integration_comment', models.TextField()),
('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')),
('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
],
options={
'abstract': False,
},
),
migrations.CreateModel(
name='Recommendation',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('is_anonymous', models.BooleanField(default=True)),
('is_public', models.BooleanField(default=False)),
('order_in_list', models.PositiveIntegerField()),
('comment', models.TextField(blank=True, null=True)),
('grade', models.PositiveIntegerField(null=True, validators=[django.core.validators.MaxValueValidator(20)])),
],
),
migrations.CreateModel(
name='RecommendationList',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('is_anonymous', models.BooleanField(default=True)),
('is_public', models.BooleanField(default=False)),
('public', models.BooleanField()),
('title', models.CharField(max_length=200)),
('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
],
),
migrations.CreateModel(
name='Semester',
fields=[
('code', models.CharField(max_length=6, primary_key=True, serialize=False)),
],
),
migrations.CreateModel(
name='Specialty',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('code', models.CharField(max_length=6)),
('name', models.CharField(max_length=100)),
('active', models.BooleanField()),
('department', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='backend.Department')),
],
),
migrations.CreateModel(
name='University',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('name', models.CharField(max_length=200)),
('acronym', models.CharField(blank=True, max_length=20, null=True)),
('logo', models.ImageField(default='path/to/my/default/image.jpg', max_length=250, upload_to=backend.utils.friendly_path.friendly_path('uploads/universities/logos/', 'name'))),
('website', models.URLField(null=True)),
],
options={
'abstract': False,
},
),
migrations.CreateModel(
name='UniversityDri',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('comment', models.TextField(blank=True)),
('usefull_links', backend.models.tools.usefullLinksField.UsefullLinksField(blank=True, default=[], validators=[backend.models.tools.usefullLinksField.validate_usefull_links])),
],
options={
'abstract': False,
},
),
migrations.CreateModel(
name='UniversityPhoto',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('photo', models.ImageField(default='path/to/my/default/image.jpg', max_length=250, upload_to=backend.utils.friendly_path.friendly_path('uploads/universities/photos/', 'title'))),
('title', models.CharField(max_length=200)),
('description', models.TextField(blank=True, null=True)),
],
),
migrations.CreateModel(
name='UniversityScholarship',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('comment', models.TextField(blank=True)),
('usefull_links', backend.models.tools.usefullLinksField.UsefullLinksField(blank=True, default=[], validators=[backend.models.tools.usefullLinksField.validate_usefull_links])),
('type', models.CharField(max_length=200)),
('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')),
],
options={
'abstract': False,
},
),
migrations.CreateModel(
name='UserData',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('is_anonymous', models.BooleanField(default=True)),
('is_public', models.BooleanField(default=False)),
('contact_info', backend.models.tools.usefullLinksField.UsefullLinksField(default=[], null=True, validators=[backend.models.tools.usefullLinksField.validate_usefull_links])),
('contact_info_is_public', models.BooleanField(default=False)),
('config', django.contrib.postgres.fields.jsonb.JSONField(default={}, null=True)),
('other_data', django.contrib.postgres.fields.jsonb.JSONField(default={}, null=True)),
('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
],
options={
'abstract': False,
},
),
migrations.CreateModel(
name='CampusAccommodation',
fields=[
('comment', models.TextField(blank=True)),
('usefull_links', backend.models.tools.usefullLinksField.UsefullLinksField(blank=True, default=[], validators=[backend.models.tools.usefullLinksField.validate_usefull_links])),
('campus', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, primary_key=True, related_name='campus_accomodation', serialize=False, to='backend.Campus')),
],
options={
'abstract': False,
},
),
migrations.CreateModel(
name='CampusCultureAndStudentLife',
fields=[
('comment', models.TextField(blank=True)),
('usefull_links', backend.models.tools.usefullLinksField.UsefullLinksField(blank=True, default=[], validators=[backend.models.tools.usefullLinksField.validate_usefull_links])),
('campus', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, primary_key=True, related_name='campus_culture_and_sl', serialize=False, to='backend.Campus')),
],
options={
'abstract': False,
},
),
migrations.CreateModel(
name='CampusOtherStuff',
fields=[
('comment', models.TextField(blank=True)),
('usefull_links', backend.models.tools.usefullLinksField.UsefullLinksField(blank=True, default=[], validators=[backend.models.tools.usefullLinksField.validate_usefull_links])),
('campus', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, primary_key=True, related_name='campus_other_stuff', serialize=False, to='backend.Campus')),
],
options={
'abstract': False,
},
),
migrations.CreateModel(
name='CampusTransport',
fields=[
('comment', models.TextField(blank=True)),
('usefull_links', backend.models.tools.usefullLinksField.UsefullLinksField(blank=True, default=[], validators=[backend.models.tools.usefullLinksField.validate_usefull_links])),
('campus', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, primary_key=True, related_name='campus_transport', serialize=False, to='backend.Campus')),
],
options={
'abstract': False,
},
),
migrations.CreateModel(
name='CityOtherStuff',
fields=[
('comment', models.TextField(blank=True)),
('usefull_links', backend.models.tools.usefullLinksField.UsefullLinksField(blank=True, default=[], validators=[backend.models.tools.usefullLinksField.validate_usefull_links])),
('city', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, primary_key=True, related_name='city_other_stuff', serialize=False, to='backend.City')),
],
options={
'abstract': False,
},
),
migrations.CreateModel(
name='CityTourism',
fields=[
('comment', models.TextField(blank=True)),
('usefull_links', backend.models.tools.usefullLinksField.UsefullLinksField(blank=True, default=[], validators=[backend.models.tools.usefullLinksField.validate_usefull_links])),
('city', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, primary_key=True, related_name='city_tourism', serialize=False, to='backend.City')),
],
options={
'abstract': False,
},
),
migrations.CreateModel(
name='CityTransport',
fields=[
('comment', models.TextField(blank=True)),
('usefull_links', backend.models.tools.usefullLinksField.UsefullLinksField(blank=True, default=[], validators=[backend.models.tools.usefullLinksField.validate_usefull_links])),
('city', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, primary_key=True, related_name='city_transport', serialize=False, to='backend.City')),
],
options={
'abstract': False,
},
),
migrations.CreateModel(
name='CountryCulture',
fields=[
('comment', models.TextField(blank=True)),
('usefull_links', backend.models.tools.usefullLinksField.UsefullLinksField(blank=True, default=[], validators=[backend.models.tools.usefullLinksField.validate_usefull_links])),
('country', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, primary_key=True, related_name='country_culture', serialize=False, to='backend.Country')),
],
options={
'abstract': False,
},
),
migrations.CreateModel(
name='CountryHealthInsurance',
fields=[
('comment', models.TextField(blank=True)),
('usefull_links', backend.models.tools.usefullLinksField.UsefullLinksField(blank=True, default=[], validators=[backend.models.tools.usefullLinksField.validate_usefull_links])),
('country', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, primary_key=True, related_name='country_health_insurances', serialize=False, to='backend.Country')),
],
options={
'abstract': False,
},
),
migrations.CreateModel(
name='CountryOtherInsurance',
fields=[
('comment', models.TextField(blank=True)),
('usefull_links', backend.models.tools.usefullLinksField.UsefullLinksField(blank=True, default=[], validators=[backend.models.tools.usefullLinksField.validate_usefull_links])),
('country', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, primary_key=True, related_name='country_other_insurances', serialize=False, to='backend.Country')),
],
options={
'abstract': False,
},
),
migrations.CreateModel(
name='CountryOtherStuff',
fields=[
('comment', models.TextField(blank=True)),
('usefull_links', backend.models.tools.usefullLinksField.UsefullLinksField(blank=True, default=[], validators=[backend.models.tools.usefullLinksField.validate_usefull_links])),
('country', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, primary_key=True, related_name='country_other_stuff', serialize=False, to='backend.Country')),
],
options={
'abstract': False,
},
),
migrations.CreateModel(
name='CountryTourism',
fields=[
('comment', models.TextField(blank=True)),
('usefull_links', backend.models.tools.usefullLinksField.UsefullLinksField(blank=True, default=[], validators=[backend.models.tools.usefullLinksField.validate_usefull_links])),
('country', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, primary_key=True, related_name='country_tourism', serialize=False, to='backend.Country')),
],
options={
'abstract': False,
},
),
migrations.CreateModel(
name='CountryTransport',
fields=[
('comment', models.TextField(blank=True)),
('usefull_links', backend.models.tools.usefullLinksField.UsefullLinksField(blank=True, default=[], validators=[backend.models.tools.usefullLinksField.validate_usefull_links])),
('country', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, primary_key=True, related_name='country_transport', serialize=False, to='backend.Country')),
],
options={
'abstract': False,
},
),
migrations.CreateModel(
name='CountryVisaAdministrative',
fields=[
('comment', models.TextField(blank=True)),
('usefull_links', backend.models.tools.usefullLinksField.UsefullLinksField(blank=True, default=[], validators=[backend.models.tools.usefullLinksField.validate_usefull_links])),
('country', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, primary_key=True, related_name='country_visa_administrative', serialize=False, to='backend.Country')),
],
options={
'abstract': False,
},
),
migrations.CreateModel(
name='UniversityCourses',
fields=[
('comment', models.TextField(blank=True)),
('usefull_links', backend.models.tools.usefullLinksField.UsefullLinksField(blank=True, default=[], validators=[backend.models.tools.usefullLinksField.validate_usefull_links])),
('university', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, primary_key=True, related_name='university_courses', serialize=False, to='backend.University')),
],
options={
'abstract': False,
},
),
migrations.CreateModel(
name='UniversityCulture',
fields=[
('comment', models.TextField(blank=True)),
('usefull_links', backend.models.tools.usefullLinksField.UsefullLinksField(blank=True, default=[], validators=[backend.models.tools.usefullLinksField.validate_usefull_links])),
('university', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, primary_key=True, related_name='university_culture', serialize=False, to='backend.University')),
],
options={
'abstract': False,
},
),
migrations.CreateModel(
name='UniversityInfo',
fields=[
('comment', models.TextField(blank=True)),
('usefull_links', backend.models.tools.usefullLinksField.UsefullLinksField(blank=True, default=[], validators=[backend.models.tools.usefullLinksField.validate_usefull_links])),
('university', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, primary_key=True, related_name='university_info', serialize=False, to='backend.University')),
('cost_exchange', models.DecimalField(decimal_places=2, max_digits=20, null=True, validators=[django.core.validators.MinValueValidator(0)])),
('cost_double_degree', models.DecimalField(decimal_places=2, max_digits=20, null=True, validators=[django.core.validators.MinValueValidator(0)])),
('costs_currency', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='backend.Currency')),
],
options={
'abstract': False,
},
),
migrations.CreateModel(
name='UniversityInsurance',
fields=[