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

Merge branch 'db_agnostic' into 'master'

Db agnostic

See merge request chehabfl/outgoing_rex!30
parents 61493e5a b6f5aa64
Pipeline #26932 passed with stages
in 2 minutes and 55 seconds
......@@ -12,3 +12,5 @@ htmlcov
.pytest_cache
/backend/urls.py
/backend/admin.py
database.db
database.db-journal
\ No newline at end of file
......@@ -3,13 +3,21 @@ from django.contrib.auth.models import User
class LoadAdminUser(object):
def __init__(self):
self.admin = User.objects.get_or_create(
username="admin",
defaults={
'email': 'null@null.fr',
'password': 'admin',
'is_staff': True
})[0]
"""
Creating admin user by creating a user and setting is_staff is True
didn't enable access to the admin system for an unkown reason.
Need to use create_superuser.
"""
user = User.objects.filter(username="admin")
if len(user) > 0:
self.admin = user[0]
else:
User.objects.create_superuser(
username="admin",
email='null@null.fr',
password='admin',
)
self.admin = User.objects.filter(username="admin")[0]
def get(self):
return self.admin
# Generated by Django 2.0.3 on 2018-09-02 14:42
# Generated by Django 2.0.3 on 2018-09-04 14:38
import backend.utils.friendly_path
import backend.models.my_model.myModel
import backend.models.tools.jSONField
import backend.models.university.university
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
......@@ -13,8 +14,8 @@ class Migration(migrations.Migration):
initial = True
dependencies = [
('contenttypes', '0002_remove_content_type_name'),
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('contenttypes', '0002_remove_content_type_name'),
]
operations = [
......@@ -24,8 +25,8 @@ class Migration(migrations.Migration):
('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=3, validators=[django.core.validators.MinValueValidator(0)])),
('usefull_links', django.contrib.postgres.fields.jsonb.JSONField(blank=True, default=list)),
('obj_moderation_level', models.SmallIntegerField(default=0, validators=[django.core.validators.MinValueValidator(0), backend.models.my_model.myModel.validate_obj_model_lv])),
('usefull_links', backend.models.tools.jSONField.JSONField(default=list)),
('is_main_campus', models.BooleanField()),
('name', models.CharField(max_length=200, null=True)),
('comment', models.TextField(blank=True, null=True)),
......@@ -39,7 +40,7 @@ class Migration(migrations.Migration):
('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=3, validators=[django.core.validators.MinValueValidator(0)])),
('obj_moderation_level', models.SmallIntegerField(default=0, validators=[django.core.validators.MinValueValidator(0), backend.models.my_model.myModel.validate_obj_model_lv])),
('name', models.CharField(max_length=200)),
('local_name', models.CharField(blank=True, max_length=200, null=True)),
('area', models.CharField(blank=True, max_length=200, null=True)),
......@@ -53,7 +54,7 @@ class Migration(migrations.Migration):
fields=[
('moderated_on', models.DateTimeField(null=True)),
('updated_on', models.DateTimeField(null=True)),
('obj_moderation_level', models.SmallIntegerField(default=3, validators=[django.core.validators.MinValueValidator(0)])),
('obj_moderation_level', models.SmallIntegerField(default=0, validators=[django.core.validators.MinValueValidator(0), backend.models.my_model.myModel.validate_obj_model_lv])),
('name', models.CharField(max_length=200)),
('iso_alpha2_code', models.CharField(max_length=2, primary_key=True, serialize=False)),
('iso_alpha3_code', models.CharField(max_length=3, unique=True)),
......@@ -74,9 +75,9 @@ class Migration(migrations.Migration):
('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=3, validators=[django.core.validators.MinValueValidator(0)])),
('obj_moderation_level', models.SmallIntegerField(default=0, validators=[django.core.validators.MinValueValidator(0), backend.models.my_model.myModel.validate_obj_model_lv])),
('comment', models.TextField(blank=True)),
('usefull_links', django.contrib.postgres.fields.jsonb.JSONField(blank=True, default=list)),
('usefull_links', backend.models.tools.jSONField.JSONField(default=list)),
],
options={
'abstract': False,
......@@ -88,9 +89,9 @@ class Migration(migrations.Migration):
('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=3, validators=[django.core.validators.MinValueValidator(0)])),
('obj_moderation_level', models.SmallIntegerField(default=0, validators=[django.core.validators.MinValueValidator(0), backend.models.my_model.myModel.validate_obj_model_lv])),
('comment', models.TextField(blank=True)),
('usefull_links', django.contrib.postgres.fields.jsonb.JSONField(blank=True, default=list)),
('usefull_links', backend.models.tools.jSONField.JSONField(default=list)),
('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)])),
......@@ -104,7 +105,7 @@ class Migration(migrations.Migration):
fields=[
('moderated_on', models.DateTimeField(null=True)),
('updated_on', models.DateTimeField(null=True)),
('obj_moderation_level', models.SmallIntegerField(default=3, validators=[django.core.validators.MinValueValidator(0)])),
('obj_moderation_level', models.SmallIntegerField(default=0, validators=[django.core.validators.MinValueValidator(0), backend.models.my_model.myModel.validate_obj_model_lv])),
('code', models.CharField(max_length=3, primary_key=True, serialize=False)),
('name', models.CharField(max_length=100)),
('symbol', models.CharField(blank=True, max_length=30, null=True)),
......@@ -121,7 +122,7 @@ class Migration(migrations.Migration):
fields=[
('moderated_on', models.DateTimeField(null=True)),
('updated_on', models.DateTimeField(null=True)),
('obj_moderation_level', models.SmallIntegerField(default=3, validators=[django.core.validators.MinValueValidator(0)])),
('obj_moderation_level', models.SmallIntegerField(default=0, validators=[django.core.validators.MinValueValidator(0), backend.models.my_model.myModel.validate_obj_model_lv])),
('code', models.CharField(max_length=6, primary_key=True, serialize=False)),
('name', models.CharField(max_length=100)),
('active', models.BooleanField()),
......@@ -138,7 +139,7 @@ class Migration(migrations.Migration):
('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=3, validators=[django.core.validators.MinValueValidator(0)])),
('obj_moderation_level', models.SmallIntegerField(default=0, validators=[django.core.validators.MinValueValidator(0), backend.models.my_model.myModel.validate_obj_model_lv])),
('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)),
('updated_by', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to=settings.AUTH_USER_MODEL)),
......@@ -153,7 +154,7 @@ class Migration(migrations.Migration):
('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=3, validators=[django.core.validators.MinValueValidator(0)])),
('obj_moderation_level', models.SmallIntegerField(default=0, validators=[django.core.validators.MinValueValidator(0), backend.models.my_model.myModel.validate_obj_model_lv])),
('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)),
('updated_by', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to=settings.AUTH_USER_MODEL)),
......@@ -168,7 +169,7 @@ class Migration(migrations.Migration):
('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=3, validators=[django.core.validators.MinValueValidator(0)])),
('obj_moderation_level', models.SmallIntegerField(default=0, validators=[django.core.validators.MinValueValidator(0), backend.models.my_model.myModel.validate_obj_model_lv])),
('nb_seats_offered', models.PositiveIntegerField()),
('nb_seats_offered_exchange', models.PositiveIntegerField(null=True)),
('nb_seats_offered_double_degree', models.PositiveIntegerField(null=True)),
......@@ -181,7 +182,7 @@ class Migration(migrations.Migration):
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('object_id', models.CharField(max_length=100)),
('updated_on', models.DateTimeField(null=True)),
('new_object', django.contrib.postgres.fields.jsonb.JSONField(default=dict)),
('new_object', backend.models.tools.jSONField.JSONField(default=dict)),
('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)),
],
......@@ -192,10 +193,10 @@ class Migration(migrations.Migration):
('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=3, validators=[django.core.validators.MinValueValidator(0)])),
('obj_moderation_level', models.SmallIntegerField(default=0, validators=[django.core.validators.MinValueValidator(0), backend.models.my_model.myModel.validate_obj_model_lv])),
('Utc_departure_id', models.IntegerField()),
('is_anonymous', models.BooleanField()),
('courses', django.contrib.postgres.fields.jsonb.JSONField(null=True)),
('courses', backend.models.tools.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)),
],
options={
......@@ -208,10 +209,10 @@ class Migration(migrations.Migration):
('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=3, validators=[django.core.validators.MinValueValidator(0)])),
('obj_moderation_level', models.SmallIntegerField(default=0, validators=[django.core.validators.MinValueValidator(0), backend.models.my_model.myModel.validate_obj_model_lv])),
('is_anonymous', models.BooleanField(default=True)),
('is_public', models.BooleanField(default=False)),
('courses_and_courses_feedback', django.contrib.postgres.fields.jsonb.JSONField(default=dict)),
('courses_and_courses_feedback', backend.models.tools.jSONField.JSONField(default=dict)),
('adequation_comment', models.TextField()),
('integration_comment', models.TextField()),
('adequation_grate', models.PositiveIntegerField(validators=[django.core.validators.MaxValueValidator(20)])),
......@@ -231,7 +232,7 @@ class Migration(migrations.Migration):
('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=3, validators=[django.core.validators.MinValueValidator(0)])),
('obj_moderation_level', models.SmallIntegerField(default=0, validators=[django.core.validators.MinValueValidator(0), backend.models.my_model.myModel.validate_obj_model_lv])),
('is_anonymous', models.BooleanField(default=True)),
('is_public', models.BooleanField(default=False)),
('order_in_list', models.PositiveIntegerField()),
......@@ -247,7 +248,7 @@ class Migration(migrations.Migration):
('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=3, validators=[django.core.validators.MinValueValidator(0)])),
('obj_moderation_level', models.SmallIntegerField(default=0, validators=[django.core.validators.MinValueValidator(0), backend.models.my_model.myModel.validate_obj_model_lv])),
('is_anonymous', models.BooleanField(default=True)),
('is_public', models.BooleanField(default=False)),
('public', models.BooleanField()),
......@@ -262,7 +263,7 @@ class Migration(migrations.Migration):
fields=[
('moderated_on', models.DateTimeField(null=True)),
('updated_on', models.DateTimeField(null=True)),
('obj_moderation_level', models.SmallIntegerField(default=3, validators=[django.core.validators.MinValueValidator(0)])),
('obj_moderation_level', models.SmallIntegerField(default=0, validators=[django.core.validators.MinValueValidator(0), backend.models.my_model.myModel.validate_obj_model_lv])),
('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)),
('updated_by', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to=settings.AUTH_USER_MODEL)),
......@@ -277,7 +278,7 @@ class Migration(migrations.Migration):
('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=3, validators=[django.core.validators.MinValueValidator(0)])),
('obj_moderation_level', models.SmallIntegerField(default=0, validators=[django.core.validators.MinValueValidator(0), backend.models.my_model.myModel.validate_obj_model_lv])),
('code', models.CharField(max_length=6)),
('name', models.CharField(max_length=100)),
('active', models.BooleanField()),
......@@ -292,9 +293,9 @@ class Migration(migrations.Migration):
('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=3, validators=[django.core.validators.MinValueValidator(0)])),
('obj_moderation_level', models.SmallIntegerField(default=0, validators=[django.core.validators.MinValueValidator(0), backend.models.my_model.myModel.validate_obj_model_lv])),
('name', models.CharField(max_length=100, unique=True)),
('config', django.contrib.postgres.fields.jsonb.JSONField(blank=True, default=dict)),
('config', backend.models.tools.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)),
('updated_by', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to=settings.AUTH_USER_MODEL)),
],
......@@ -308,11 +309,12 @@ class Migration(migrations.Migration):
('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=3, validators=[django.core.validators.MinValueValidator(0)])),
('obj_moderation_level', models.SmallIntegerField(default=0, validators=[django.core.validators.MinValueValidator(0), backend.models.my_model.myModel.validate_obj_model_lv])),
('name', models.CharField(max_length=200)),
('acronym', models.CharField(blank=True, max_length=20, null=True)),
('logo', models.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)),
('logo', models.URLField(blank=True, null=True, validators=[backend.models.university.university.validate_extension_django])),
('website', models.URLField(blank=True, null=True)),
('utc_id', models.IntegerField(unique=True)),
],
options={
'abstract': False,
......@@ -324,9 +326,9 @@ class Migration(migrations.Migration):
('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=3, validators=[django.core.validators.MinValueValidator(0)])),
('obj_moderation_level', models.SmallIntegerField(default=0, validators=[django.core.validators.MinValueValidator(0), backend.models.my_model.myModel.validate_obj_model_lv])),
('comment', models.TextField(blank=True)),
('usefull_links', django.contrib.postgres.fields.jsonb.JSONField(blank=True, default=list)),
('usefull_links', backend.models.tools.jSONField.JSONField(default=list)),
('moderated_by', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to=settings.AUTH_USER_MODEL)),
],
options={
......@@ -339,9 +341,9 @@ class Migration(migrations.Migration):
('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=3, validators=[django.core.validators.MinValueValidator(0)])),
('obj_moderation_level', models.SmallIntegerField(default=0, validators=[django.core.validators.MinValueValidator(0), backend.models.my_model.myModel.validate_obj_model_lv])),
('comment', models.TextField(blank=True)),
('usefull_links', django.contrib.postgres.fields.jsonb.JSONField(blank=True, default=list)),
('usefull_links', backend.models.tools.jSONField.JSONField(default=list)),
('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)])),
......@@ -358,11 +360,11 @@ class Migration(migrations.Migration):
('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=3, validators=[django.core.validators.MinValueValidator(0)])),
('contact_info', django.contrib.postgres.fields.jsonb.JSONField(default=dict)),
('obj_moderation_level', models.SmallIntegerField(default=0, validators=[django.core.validators.MinValueValidator(0), backend.models.my_model.myModel.validate_obj_model_lv])),
('contact_info', backend.models.tools.jSONField.JSONField(default=dict)),
('contact_info_is_public', models.BooleanField(default=False)),
('config', django.contrib.postgres.fields.jsonb.JSONField(default=dict)),
('other_data', django.contrib.postgres.fields.jsonb.JSONField(default=dict)),
('config', backend.models.tools.jSONField.JSONField(default=dict)),
('other_data', backend.models.tools.jSONField.JSONField(default=dict)),
],
options={
'abstract': False,
......@@ -373,8 +375,8 @@ class Migration(migrations.Migration):
fields=[
('moderated_on', models.DateTimeField(null=True)),
('updated_on', models.DateTimeField(null=True)),
('obj_moderation_level', models.SmallIntegerField(default=3, validators=[django.core.validators.MinValueValidator(0)])),
('custom_content', django.contrib.postgres.fields.jsonb.JSONField(default=dict)),
('obj_moderation_level', models.SmallIntegerField(default=0, validators=[django.core.validators.MinValueValidator(0), backend.models.my_model.myModel.validate_obj_model_lv])),
('custom_content', backend.models.tools.jSONField.JSONField(default=dict)),
('campus', models.OneToOneField(on_delete=django.db.models.deletion.PROTECT, primary_key=True, related_name='city_items', serialize=False, to='backend.Campus')),
('moderated_by', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to=settings.AUTH_USER_MODEL)),
('tag', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='+', to='backend.Tag')),
......@@ -386,8 +388,8 @@ class Migration(migrations.Migration):
fields=[
('moderated_on', models.DateTimeField(null=True)),
('updated_on', models.DateTimeField(null=True)),
('obj_moderation_level', models.SmallIntegerField(default=3, validators=[django.core.validators.MinValueValidator(0)])),
('custom_content', django.contrib.postgres.fields.jsonb.JSONField(default=dict)),
('obj_moderation_level', models.SmallIntegerField(default=0, validators=[django.core.validators.MinValueValidator(0), backend.models.my_model.myModel.validate_obj_model_lv])),
('custom_content', backend.models.tools.jSONField.JSONField(default=dict)),
('city', models.OneToOneField(on_delete=django.db.models.deletion.PROTECT, primary_key=True, related_name='city_items', serialize=False, to='backend.City')),
('moderated_by', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to=settings.AUTH_USER_MODEL)),
('tag', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='+', to='backend.Tag')),
......@@ -399,8 +401,8 @@ class Migration(migrations.Migration):
fields=[
('moderated_on', models.DateTimeField(null=True)),
('updated_on', models.DateTimeField(null=True)),
('obj_moderation_level', models.SmallIntegerField(default=3, validators=[django.core.validators.MinValueValidator(0)])),
('custom_content', django.contrib.postgres.fields.jsonb.JSONField(default=dict)),
('obj_moderation_level', models.SmallIntegerField(default=0, validators=[django.core.validators.MinValueValidator(0), backend.models.my_model.myModel.validate_obj_model_lv])),
('custom_content', backend.models.tools.jSONField.JSONField(default=dict)),
('country', models.OneToOneField(on_delete=django.db.models.deletion.PROTECT, primary_key=True, related_name='country_items', serialize=False, to='backend.Country')),
('moderated_by', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to=settings.AUTH_USER_MODEL)),
('tag', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='+', to='backend.Tag')),
......@@ -412,9 +414,9 @@ class Migration(migrations.Migration):
fields=[
('moderated_on', models.DateTimeField(null=True)),
('updated_on', models.DateTimeField(null=True)),
('obj_moderation_level', models.SmallIntegerField(default=3, validators=[django.core.validators.MinValueValidator(0)])),
('obj_moderation_level', models.SmallIntegerField(default=0, validators=[django.core.validators.MinValueValidator(0), backend.models.my_model.myModel.validate_obj_model_lv])),
('comment', models.TextField(blank=True)),
('usefull_links', django.contrib.postgres.fields.jsonb.JSONField(blank=True, default=list)),
('usefull_links', backend.models.tools.jSONField.JSONField(default=list)),
('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)])),
......@@ -431,9 +433,9 @@ class Migration(migrations.Migration):
fields=[
('moderated_on', models.DateTimeField(null=True)),
('updated_on', models.DateTimeField(null=True)),
('obj_moderation_level', models.SmallIntegerField(default=3, validators=[django.core.validators.MinValueValidator(0)])),
('obj_moderation_level', models.SmallIntegerField(default=0, validators=[django.core.validators.MinValueValidator(0), backend.models.my_model.myModel.validate_obj_model_lv])),
('comment', models.TextField(blank=True)),
('usefull_links', django.contrib.postgres.fields.jsonb.JSONField(blank=True, default=list)),
('usefull_links', backend.models.tools.jSONField.JSONField(default=list)),
('university', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, primary_key=True, related_name='university_semesters_dates', serialize=False, to='backend.University')),
('spring_begin', models.DateField(blank=True, null=True)),
('spring_end', models.DateField(blank=True, null=True)),
......@@ -451,8 +453,8 @@ class Migration(migrations.Migration):
fields=[
('moderated_on', models.DateTimeField(null=True)),
('updated_on', models.DateTimeField(null=True)),
('obj_moderation_level', models.SmallIntegerField(default=3, validators=[django.core.validators.MinValueValidator(0)])),
('custom_content', django.contrib.postgres.fields.jsonb.JSONField(default=dict)),
('obj_moderation_level', models.SmallIntegerField(default=0, validators=[django.core.validators.MinValueValidator(0), backend.models.my_model.myModel.validate_obj_model_lv])),
('custom_content', backend.models.tools.jSONField.JSONField(default=dict)),
('university', models.OneToOneField(on_delete=django.db.models.deletion.PROTECT, primary_key=True, related_name='city_items', serialize=False, to='backend.University')),
('moderated_by', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to=settings.AUTH_USER_MODEL)),
('tag', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='+', to='backend.Tag')),
......
# Generated by Django 2.0.3 on 2018-09-02 15:16
import backend.models.my_model.myModel
import django.core.validators
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('backend', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='campus',
name='obj_moderation_level',
field=models.SmallIntegerField(default=0, validators=[django.core.validators.MinValueValidator(0), backend.models.my_model.myModel.validate_obj_model_lv]),
),
migrations.AlterField(
model_name='campustaggeditem',
name='obj_moderation_level',
field=models.SmallIntegerField(default=0, validators=[django.core.validators.MinValueValidator(0), backend.models.my_model.myModel.validate_obj_model_lv]),
),
migrations.AlterField(
model_name='city',
name='obj_moderation_level',
field=models.SmallIntegerField(default=0, validators=[django.core.validators.MinValueValidator(0), backend.models.my_model.myModel.validate_obj_model_lv]),
),
migrations.AlterField(
model_name='citytaggeditem',
name='obj_moderation_level',
field=models.SmallIntegerField(default=0, validators=[django.core.validators.MinValueValidator(0), backend.models.my_model.myModel.validate_obj_model_lv]),
),
migrations.AlterField(
model_name='country',
name='obj_moderation_level',
field=models.SmallIntegerField(default=0, validators=[django.core.validators.MinValueValidator(0), backend.models.my_model.myModel.validate_obj_model_lv]),
),
migrations.AlterField(
model_name='countrydri',
name='obj_moderation_level',
field=models.SmallIntegerField(default=0, validators=[django.core.validators.MinValueValidator(0), backend.models.my_model.myModel.validate_obj_model_lv]),
),
migrations.AlterField(
model_name='countryscholarship',
name='obj_moderation_level',
field=models.SmallIntegerField(default=0, validators=[django.core.validators.MinValueValidator(0), backend.models.my_model.myModel.validate_obj_model_lv]),
),
migrations.AlterField(
model_name='countrytaggeditem',
name='obj_moderation_level',
field=models.SmallIntegerField(default=0, validators=[django.core.validators.MinValueValidator(0), backend.models.my_model.myModel.validate_obj_model_lv]),
),
migrations.AlterField(
model_name='currency',
name='obj_moderation_level',
field=models.SmallIntegerField(default=0, validators=[django.core.validators.MinValueValidator(0), backend.models.my_model.myModel.validate_obj_model_lv]),
),
migrations.AlterField(
model_name='department',
name='obj_moderation_level',
field=models.SmallIntegerField(default=0, validators=[django.core.validators.MinValueValidator(0), backend.models.my_model.myModel.validate_obj_model_lv]),
),
migrations.AlterField(
model_name='fortestingmoderation',
name='obj_moderation_level',
field=models.SmallIntegerField(default=0, validators=[django.core.validators.MinValueValidator(0), backend.models.my_model.myModel.validate_obj_model_lv]),
),
migrations.AlterField(
model_name='fortestingversioning',
name='obj_moderation_level',
field=models.SmallIntegerField(default=0, validators=[django.core.validators.MinValueValidator(0), backend.models.my_model.myModel.validate_obj_model_lv]),
),
migrations.AlterField(
model_name='offer',
name='obj_moderation_level',
field=models.SmallIntegerField(default=0, validators=[django.core.validators.MinValueValidator(0), backend.models.my_model.myModel.validate_obj_model_lv]),
),
migrations.AlterField(
model_name='previousdeparture',
name='obj_moderation_level',
field=models.SmallIntegerField(default=0, validators=[django.core.validators.MinValueValidator(0), backend.models.my_model.myModel.validate_obj_model_lv]),
),
migrations.AlterField(
model_name='previousdeparturefeedback',
name='obj_moderation_level',
field=models.SmallIntegerField(default=0, validators=[django.core.validators.MinValueValidator(0), backend.models.my_model.myModel.validate_obj_model_lv]),
),
migrations.AlterField(
model_name='recommendation',
name='obj_moderation_level',
field=models.SmallIntegerField(default=0, validators=[django.core.validators.MinValueValidator(0), backend.models.my_model.myModel.validate_obj_model_lv]),
),
migrations.AlterField(
model_name='recommendationlist',
name='obj_moderation_level',
field=models.SmallIntegerField(default=0, validators=[django.core.validators.MinValueValidator(0), backend.models.my_model.myModel.validate_obj_model_lv]),
),
migrations.AlterField(
model_name='semester',
name='obj_moderation_level',
field=models.SmallIntegerField(default=0, validators=[django.core.validators.MinValueValidator(0), backend.models.my_model.myModel.validate_obj_model_lv]),
),
migrations.AlterField(
model_name='specialty',
name='obj_moderation_level',
field=models.SmallIntegerField(default=0, validators=[django.core.validators.MinValueValidator(0), backend.models.my_model.myModel.validate_obj_model_lv]),
),
migrations.AlterField(
model_name='tag',
name='obj_moderation_level',
field=models.SmallIntegerField(default=0, validators=[django.core.validators.MinValueValidator(0), backend.models.my_model.myModel.validate_obj_model_lv]),
),
migrations.AlterField(
model_name='university',
name='obj_moderation_level',
field=models.SmallIntegerField(default=0, validators=[django.core.validators.MinValueValidator(0), backend.models.my_model.myModel.validate_obj_model_lv]),
),
migrations.AlterField(
model_name='universitydri',
name='obj_moderation_level',
field=models.SmallIntegerField(default=0, validators=[django.core.validators.MinValueValidator(0), backend.models.my_model.myModel.validate_obj_model_lv]),
),
migrations.AlterField(
model_name='universityinfo',
name='obj_moderation_level',
field=models.SmallIntegerField(default=0, validators=[django.core.validators.MinValueValidator(0), backend.models.my_model.myModel.validate_obj_model_lv]),
),
migrations.AlterField(
model_name='universityscholarship',
name='obj_moderation_level',
field=models.SmallIntegerField(default=0, validators=[django.core.validators.MinValueValidator(0), backend.models.my_model.myModel.validate_obj_model_lv]),
),
migrations.AlterField(
model_name='universitysemestersdates',
name='obj_moderation_level',
field=models.SmallIntegerField(default=0, validators=[django.core.validators.MinValueValidator(0), backend.models.my_model.myModel.validate_obj_model_lv]),
),
migrations.AlterField(
model_name='universitytaggeditem',
name='obj_moderation_level',
field=models.SmallIntegerField(default=0, validators=[django.core.validators.MinValueValidator(0), backend.models.my_model.myModel.validate_obj_model_lv]),
),
migrations.AlterField(
model_name='userdata',
name='obj_moderation_level',
field=models.SmallIntegerField(default=0, validators=[django.core.validators.MinValueValidator(0), backend.models.my_model.myModel.validate_obj_model_lv]),
),
]
# Generated by Django 2.0.3 on 2018-09-03 07:53
import backend.models.university.university
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('backend', '0002_auto_20180902_1716'),
]
operations = [
migrations.AddField(