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.conf.urls import url, include
from rex import views
from backend import views
from rest_framework import routers
from rex.models.location import CountryViewSet
from rex.models.location import CityViewSet
from rex.models.module import CurrencyViewSet
from rex.models.otherCore import DepartmentViewSet
from rex.models.otherCore import OfferViewSet
from rex.models.otherCore import SemesterViewSet
from rex.models.otherCore import SpecialtyViewSet
from rex.models.location import CountryCultureViewSet
from rex.models.location import CountryHealthInsuranceViewSet
from rex.models.location import CountryOtherInsuranceViewSet
from rex.models.location import CountryTransportViewSet
from rex.models.location import CountryTourismViewSet
from rex.models.location import CountryOtherStuffViewSet
from rex.models.location import CountryVisaAdministrativeViewSet
from rex.models.location import CountryPhotoViewSet
from rex.models.location import CountryScholarshipViewSet
from rex.models.location import CountryDriViewSet
from rex.models.location import CityTransportViewSet
from rex.models.location import CityTourismViewSet
from rex.models.location import CityOtherStuffViewSet
from rex.models.location import CityPhotoViewSet
from rex.models.university import UniversityViewSet
from rex.models.university import CampusViewSet
from rex.models.university import UniversityScholarshipViewSet
from rex.models.university import UniversityInfoViewSet
from rex.models.university import UniversitySemestersDatesViewSet
from rex.models.university import UniversityInsuranceViewSet
from rex.models.university import UniversityCoursesViewSet
from rex.models.university import UniversityCultureViewSet
from rex.models.university import UniversityOtherStuffViewSet
from rex.models.university import UniversitySpecialOfferViewSet
from rex.models.university import UniversityPhotoViewSet
from rex.models.university import UniversityDriViewSet
from rex.models.university import CampusTransportViewSet
from rex.models.university import CampusAccommodationViewSet
from rex.models.university import CampusCultureAndStudentLifeViewSet
from rex.models.university import CampusOtherStuffViewSet
from rex.models.user import RecommendationViewSet
from rex.models.user import RecommendationListViewSet
from rex.models.user import PreviousDepartureViewSet
from rex.models.user import PreviousDepartureFeedbackViewSet
from rex.models.user import UserDataViewSet
from backend.models.location import CountryViewSet
from backend.models.location import CityViewSet
from backend.models.module import CurrencyViewSet
from backend.models.otherCore import DepartmentViewSet
from backend.models.otherCore import OfferViewSet
from backend.models.otherCore import SemesterViewSet
from backend.models.otherCore import SpecialtyViewSet
from backend.models.location import CountryCultureViewSet
from backend.models.location import CountryHealthInsuranceViewSet
from backend.models.location import CountryOtherInsuranceViewSet
from backend.models.location import CountryTransportViewSet
from backend.models.location import CountryTourismViewSet
from backend.models.location import CountryOtherStuffViewSet
from backend.models.location import CountryVisaAdministrativeViewSet
from backend.models.location import CountryPhotoViewSet
from backend.models.location import CountryScholarshipViewSet
from backend.models.location import CountryDriViewSet
from backend.models.location import CityTransportViewSet
from backend.models.location import CityTourismViewSet
from backend.models.location import CityOtherStuffViewSet
from backend.models.location import CityPhotoViewSet
from backend.models.university import UniversityViewSet
from backend.models.university import CampusViewSet
from backend.models.university import UniversityScholarshipViewSet
from backend.models.university import UniversityInfoViewSet
from backend.models.university import UniversitySemestersDatesViewSet
from backend.models.university import UniversityInsuranceViewSet
from backend.models.university import UniversityCoursesViewSet
from backend.models.university import UniversityCultureViewSet
from backend.models.university import UniversityOtherStuffViewSet
from backend.models.university import UniversitySpecialOfferViewSet
from backend.models.university import UniversityPhotoViewSet
from backend.models.university import UniversityDriViewSet
from backend.models.university import CampusTransportViewSet
from backend.models.university import CampusAccommodationViewSet
from backend.models.university import CampusCultureAndStudentLifeViewSet
from backend.models.university import CampusOtherStuffViewSet
from backend.models.user import RecommendationViewSet
from backend.models.user import RecommendationListViewSet
from backend.models.user import PreviousDepartureViewSet
from backend.models.user import PreviousDepartureFeedbackViewSet
from backend.models.user import UserDataViewSet
from rest_framework.documentation import include_docs_urls
......
from django.shortcuts import render
from rex.models.university import Campus
from backend.models.university import Campus
def home(request):
......
......@@ -13,6 +13,6 @@ Pour charger des données dans l'application, tout se passe via l'API du site.
- Lancer les scripts pour insérer les données :
```
./rex/utils/insert_country.py -t <Token> [-a <server adress>]
./rex/utils/insert_universities.py-t <Token> [-a <Adresse-de-l'API>]
./backend/utils/insert_country.py -t <Token> [-a <server adress>]
./backend/utils/insert_universities.py-t <Token> [-a <Adresse-de-l'API>]
```
......@@ -32,7 +32,7 @@ INSTALLED_APPS = [
'rest_framework',
'rest_framework.authtoken',
'main_website',
'rex'
'backend'
]
MIDDLEWARE = [
......
......@@ -16,5 +16,5 @@ urlpatterns = [
url(r'^user/callback$',
django_cas_ng.views.callback,
name='cas_ng_proxy_callback'),
url(r'', include('rex.urls')),
url(r'', include('backend.urls')),
] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
# Generated by Django 2.0.3 on 2018-08-19 16:53
import django.core.validators
from django.db import migrations, models
import django.db.models.deletion
import rex.utils.friendly_path
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Campus',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('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='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='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=rex.utils.friendly_path.friendly_path('uploads/universities/logos/', 'name'))),
('website', models.URLField(null=True)),
],
options={
'abstract': False,
},
),
migrations.AddField(
model_name='city',
name='country',
field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='rex.Country'),
),
migrations.AddField(
model_name='campus',
name='city',
field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='rex.City'),
),
migrations.AddField(
model_name='campus',
name='university',
field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='univCampus', to='rex.University'),
),
migrations.AlterUniqueTogether(
name='campus',
unique_together={('is_main_campus', 'university')},
),
]
# Generated by Django 2.0.3 on 2018-08-19 19:46
import django.core.validators
from django.db import migrations, models
import django.db.models.deletion
import rex.models.tools.usefullLinksField
class Migration(migrations.Migration):
dependencies = [
('rex', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='UniversityScholarship',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('comment', models.TextField()),
('usefull_links', rex.models.tools.usefullLinksField.UsefullLinksField(validators=[rex.models.tools.usefullLinksField.validate_usefull_links])),
('type', models.CharField(max_length=200)),
('currency', models.CharField(max_length=50)),
('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)])),
('university', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='univScholarship', to='rex.University')),
],
options={
'abstract': False,
},
),
]
# Generated by Django 2.0.3 on 2018-08-20 14:54
import django.core.validators
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('rex', '0002_universityscholarship'),
]
operations = [
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)])),
],
),
]
# Generated by Django 2.0.3 on 2018-08-20 15:00
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('rex', '0003_currency'),
]
operations = [
migrations.AlterField(
model_name='universityscholarship',
name='currency',
field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='rex.Currency'),
),
]
# Generated by Django 2.0.3 on 2018-08-20 15:02
from django.db import migrations, models
import rex.models.tools.usefullLinksField
class Migration(migrations.Migration):
dependencies = [
('rex', '0004_auto_20180820_1700'),
]
operations = [
migrations.AlterField(
model_name='universityscholarship',
name='comment',
field=models.TextField(blank=True),
),
migrations.AlterField(
model_name='universityscholarship',
name='usefull_links',
field=rex.models.tools.usefullLinksField.UsefullLinksField(null=True, validators=[rex.models.tools.usefullLinksField.validate_usefull_links]),
),
]
# Generated by Django 2.0.3 on 2018-08-20 15:15
from django.db import migrations
import rex.models.tools.usefullLinksField
class Migration(migrations.Migration):
dependencies = [
('rex', '0005_auto_20180820_1702'),
]
operations = [
migrations.AlterField(
model_name='universityscholarship',
name='usefull_links',
field=rex.models.tools.usefullLinksField.UsefullLinksField(blank=True, default=[], validators=[rex.models.tools.usefullLinksField.validate_usefull_links]),
),
]
# Generated by Django 2.0.3 on 2018-08-20 15:48
import django.core.validators
from django.db import migrations, models
import django.db.models.deletion
import rex.models.tools.usefullLinksField
class Migration(migrations.Migration):
dependencies = [
('rex', '0006_auto_20180820_1715'),
]
operations = [
migrations.CreateModel(
name='UniversityInfo',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('comment', models.TextField(blank=True)),
('usefull_links', rex.models.tools.usefullLinksField.UsefullLinksField(blank=True, default=[], validators=[rex.models.tools.usefullLinksField.validate_usefull_links])),
('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='rex.Currency')),
('university', models.OneToOneField(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='university_info', to='rex.University')),
],
options={
'abstract': False,
},
),
]
# Generated by Django 2.0.3 on 2018-08-20 15:52
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('rex', '0007_universityinfo'),
]
operations = [
migrations.RemoveField(
model_name='universityinfo',
name='id',
),
migrations.AlterField(
model_name='universityinfo',
name='university',
field=models.OneToOneField(default=1, on_delete=django.db.models.deletion.CASCADE, primary_key=True, related_name='university_info', serialize=False, to='rex.University'),
preserve_default=False,
),
]
# Generated by Django 2.0.3 on 2018-08-20 16:23
from django.db import migrations, models
import django.db.models.deletion
import rex.models.tools.usefullLinksField
class Migration(migrations.Migration):
dependencies = [
('rex', '0008_auto_20180820_1752'),
]
operations = [
migrations.CreateModel(
name='SemestersDates',
fields=[
('comment', models.TextField(blank=True)),
('usefull_links', rex.models.tools.usefullLinksField.UsefullLinksField(blank=True, default=[], validators=[rex.models.tools.usefullLinksField.validate_usefull_links])),
('university', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, primary_key=True, related_name='university_semesters_dates', serialize=False, to='rex.University')),
('spring_begin', models.DateField(null=True)),
('spring_end', models.DateField(null=True)),
('autumn_begin', models.DateField(null=True)),
('autumn_end', models.DateField(null=True)),
],
options={
'abstract': False,
},
),
]
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