Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Rex Dri
Rex Dri
Commits
7aeec929
Commit
7aeec929
authored
Sep 16, 2018
by
Florent Chehab
Browse files
Small update on backend texts fields
parent
a0e5e515
Changes
12
Hide whitespace changes
Inline
Side-by-side
backend/migrations/0001_initial.py
View file @
7aeec929
# Generated by Django 2.0.3 on 2018-09-1
5
1
1:4
1
# Generated by Django 2.0.3 on 2018-09-1
6
1
3:3
1
import
backend.fields
import
backend.models.abstract.my_model.myModel
...
...
@@ -14,8 +14,8 @@ class Migration(migrations.Migration):
initial
=
True
dependencies
=
[
(
'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
),
]
...
...
@@ -27,9 +27,12 @@ class Migration(migrations.Migration):
(
'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
])),
(
'title'
,
models
.
CharField
(
default
=
''
,
max_length
=
150
)),
(
'comment'
,
models
.
CharField
(
default
=
''
,
max_length
=
5000
)),
(
'useful_links'
,
backend
.
fields
.
JSONField
(
default
=
list
)),
(
'importance_level'
,
models
.
CharField
(
choices
=
[(
'-'
,
'normal'
),
(
'+'
,
'important'
),
(
'++'
,
'IMPORTANT'
)],
default
=
'-'
,
max_length
=
2
)),
(
'is_main_campus'
,
models
.
BooleanField
()),
(
'name'
,
models
.
CharField
(
max_length
=
200
,
null
=
True
)),
(
'comment'
,
models
.
TextField
(
blank
=
True
,
null
=
True
)),
(
'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
)])),
],
...
...
@@ -42,7 +45,7 @@ class Migration(migrations.Migration):
(
'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
])),
(
'title'
,
models
.
CharField
(
default
=
''
,
max_length
=
150
)),
(
'comment'
,
models
.
Text
Field
(
blank
=
True
,
default
=
''
)),
(
'comment'
,
models
.
Char
Field
(
default
=
''
,
max_length
=
5000
)),
(
'useful_links'
,
backend
.
fields
.
JSONField
(
default
=
list
)),
(
'importance_level'
,
models
.
CharField
(
choices
=
[(
'-'
,
'normal'
),
(
'+'
,
'important'
),
(
'++'
,
'IMPORTANT'
)],
default
=
'-'
,
max_length
=
2
)),
(
'custom_content'
,
backend
.
fields
.
JSONField
(
default
=
dict
)),
...
...
@@ -57,8 +60,8 @@ class Migration(migrations.Migration):
(
'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
])),
(
'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
)),
(
'local_name'
,
models
.
CharField
(
default
=
''
,
max_length
=
200
)),
(
'area'
,
models
.
CharField
(
default
=
''
,
max_length
=
200
)),
],
options
=
{
'abstract'
:
False
,
...
...
@@ -72,7 +75,7 @@ class Migration(migrations.Migration):
(
'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
])),
(
'title'
,
models
.
CharField
(
default
=
''
,
max_length
=
150
)),
(
'comment'
,
models
.
Text
Field
(
blank
=
True
,
default
=
''
)),
(
'comment'
,
models
.
Char
Field
(
default
=
''
,
max_length
=
5000
)),
(
'useful_links'
,
backend
.
fields
.
JSONField
(
default
=
list
)),
(
'importance_level'
,
models
.
CharField
(
choices
=
[(
'-'
,
'normal'
),
(
'+'
,
'important'
),
(
'++'
,
'IMPORTANT'
)],
default
=
'-'
,
max_length
=
2
)),
(
'custom_content'
,
backend
.
fields
.
JSONField
(
default
=
dict
)),
...
...
@@ -87,13 +90,13 @@ class Migration(migrations.Migration):
(
'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
)),
(
'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
(
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
(
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
)),
(
'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
,
...
...
@@ -107,7 +110,7 @@ class Migration(migrations.Migration):
(
'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
])),
(
'title'
,
models
.
CharField
(
default
=
''
,
max_length
=
150
)),
(
'comment'
,
models
.
Text
Field
(
blank
=
True
,
default
=
''
)),
(
'comment'
,
models
.
Char
Field
(
default
=
''
,
max_length
=
5000
)),
(
'useful_links'
,
backend
.
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.Country'
)),
...
...
@@ -124,13 +127,14 @@ class Migration(migrations.Migration):
(
'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
])),
(
'title'
,
models
.
CharField
(
default
=
''
,
max_length
=
150
)),
(
'comment'
,
models
.
Text
Field
(
blank
=
True
,
default
=
''
)),
(
'comment'
,
models
.
Char
Field
(
default
=
''
,
max_length
=
5000
)),
(
'useful_links'
,
backend
.
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
,
validators
=
[
django
.
core
.
validators
.
MinValueValidator
(
0
)])),
(
'amount_max'
,
models
.
DecimalField
(
decimal_places
=
2
,
max_digits
=
20
,
validators
=
[
django
.
core
.
validators
.
MinValueValidator
(
0
)])),
(
'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.Country'
)),
],
options
=
{
...
...
@@ -145,7 +149,7 @@ class Migration(migrations.Migration):
(
'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
])),
(
'title'
,
models
.
CharField
(
default
=
''
,
max_length
=
150
)),
(
'comment'
,
models
.
Text
Field
(
blank
=
True
,
default
=
''
)),
(
'comment'
,
models
.
Char
Field
(
default
=
''
,
max_length
=
5000
)),
(
'useful_links'
,
backend
.
fields
.
JSONField
(
default
=
list
)),
(
'importance_level'
,
models
.
CharField
(
choices
=
[(
'-'
,
'normal'
),
(
'+'
,
'important'
),
(
'++'
,
'IMPORTANT'
)],
default
=
'-'
,
max_length
=
2
)),
(
'custom_content'
,
backend
.
fields
.
JSONField
(
default
=
dict
)),
...
...
@@ -160,7 +164,7 @@ class Migration(migrations.Migration):
(
'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
)),
(
'name'
,
models
.
CharField
(
max_length
=
100
)),
(
'symbol'
,
models
.
CharField
(
blank
=
True
,
max_length
=
30
,
null
=
True
)),
(
'symbol'
,
models
.
CharField
(
default
=
''
,
max_length
=
30
)),
(
'one_EUR_in_this_currency'
,
models
.
DecimalField
(
decimal_places
=
6
,
max_digits
=
20
,
validators
=
[
django
.
core
.
validators
.
MinValueValidator
(
0
)])),
],
options
=
{
...
...
@@ -254,8 +258,8 @@ class Migration(migrations.Migration):
(
'is_anonymous'
,
models
.
BooleanField
(
default
=
True
)),
(
'is_public'
,
models
.
BooleanField
(
default
=
False
)),
(
'courses_and_courses_feedback'
,
backend
.
fields
.
JSONField
(
default
=
dict
)),
(
'adequation_comment'
,
models
.
Text
Field
()),
(
'integration_comment'
,
models
.
Text
Field
()),
(
'adequation_comment'
,
models
.
Char
Field
(
default
=
''
,
max_length
=
5000
)),
(
'integration_comment'
,
models
.
Char
Field
(
default
=
''
,
max_length
=
5000
)),
(
'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'
)),
...
...
@@ -274,7 +278,7 @@ class Migration(migrations.Migration):
(
'is_anonymous'
,
models
.
BooleanField
(
default
=
True
)),
(
'is_public'
,
models
.
BooleanField
(
default
=
False
)),
(
'order_in_list'
,
models
.
PositiveIntegerField
()),
(
'comment'
,
models
.
Text
Field
(
blank
=
True
,
null
=
True
)),
(
'comment'
,
models
.
Char
Field
(
default
=
''
,
max_length
=
5000
)),
(
'grade'
,
models
.
PositiveIntegerField
(
null
=
True
,
validators
=
[
django
.
core
.
validators
.
MaxValueValidator
(
20
)])),
],
),
...
...
@@ -338,9 +342,9 @@ class Migration(migrations.Migration):
(
'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
])),
(
'name'
,
models
.
CharField
(
max_length
=
200
)),
(
'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
])),
(
'website'
,
models
.
URLField
(
blank
=
True
,
max_length
=
300
,
null
=
True
)),
(
'acronym'
,
models
.
CharField
(
default
=
''
,
max_length
=
20
)),
(
'logo'
,
models
.
URLField
(
default
=
''
,
validators
=
[
backend
.
models
.
university
.
university
.
validate_extension_django
])),
(
'website'
,
models
.
URLField
(
default
=
''
,
max_length
=
300
)),
(
'utc_id'
,
models
.
IntegerField
(
unique
=
True
)),
],
options
=
{
...
...
@@ -355,7 +359,7 @@ class Migration(migrations.Migration):
(
'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
])),
(
'title'
,
models
.
CharField
(
default
=
''
,
max_length
=
150
)),
(
'comment'
,
models
.
Text
Field
(
blank
=
True
,
default
=
''
)),
(
'comment'
,
models
.
Char
Field
(
default
=
''
,
max_length
=
5000
)),
(
'useful_links'
,
backend
.
fields
.
JSONField
(
default
=
list
)),
(
'importance_level'
,
models
.
CharField
(
choices
=
[(
'-'
,
'normal'
),
(
'+'
,
'important'
),
(
'++'
,
'IMPORTANT'
)],
default
=
'-'
,
max_length
=
2
)),
],
...
...
@@ -371,14 +375,15 @@ class Migration(migrations.Migration):
(
'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
])),
(
'title'
,
models
.
CharField
(
default
=
''
,
max_length
=
150
)),
(
'comment'
,
models
.
Text
Field
(
blank
=
True
,
default
=
''
)),
(
'comment'
,
models
.
Char
Field
(
default
=
''
,
max_length
=
5000
)),
(
'useful_links'
,
backend
.
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
,
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'
)),
(
'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
)])),
(
'currency'
,
models
.
ForeignKey
(
null
=
True
,
on_delete
=
django
.
db
.
models
.
deletion
.
PROTECT
,
to
=
'backend.Currency'
)),
],
options
=
{
'abstract'
:
False
,
...
...
@@ -392,7 +397,7 @@ class Migration(migrations.Migration):
(
'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
])),
(
'title'
,
models
.
CharField
(
default
=
''
,
max_length
=
150
)),
(
'comment'
,
models
.
Text
Field
(
blank
=
True
,
default
=
''
)),
(
'comment'
,
models
.
Char
Field
(
default
=
''
,
max_length
=
5000
)),
(
'useful_links'
,
backend
.
fields
.
JSONField
(
default
=
list
)),
(
'importance_level'
,
models
.
CharField
(
choices
=
[(
'-'
,
'normal'
),
(
'+'
,
'important'
),
(
'++'
,
'IMPORTANT'
)],
default
=
'-'
,
max_length
=
2
)),
(
'custom_content'
,
backend
.
fields
.
JSONField
(
default
=
dict
)),
...
...
@@ -421,7 +426,7 @@ class Migration(migrations.Migration):
(
'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
])),
(
'title'
,
models
.
CharField
(
default
=
''
,
max_length
=
150
)),
(
'comment'
,
models
.
Text
Field
(
blank
=
True
,
default
=
''
)),
(
'comment'
,
models
.
Char
Field
(
default
=
''
,
max_length
=
5000
)),
(
'useful_links'
,
backend
.
fields
.
JSONField
(
default
=
list
)),
(
'importance_level'
,
models
.
CharField
(
choices
=
[(
'-'
,
'normal'
),
(
'+'
,
'important'
),
(
'++'
,
'IMPORTANT'
)],
default
=
'-'
,
max_length
=
2
)),
(
'university'
,
models
.
OneToOneField
(
on_delete
=
django
.
db
.
models
.
deletion
.
CASCADE
,
primary_key
=
True
,
related_name
=
'university_info'
,
serialize
=
False
,
to
=
'backend.University'
)),
...
...
@@ -439,7 +444,7 @@ class Migration(migrations.Migration):
(
'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
])),
(
'title'
,
models
.
CharField
(
default
=
''
,
max_length
=
150
)),
(
'comment'
,
models
.
Text
Field
(
blank
=
True
,
default
=
''
)),
(
'comment'
,
models
.
Char
Field
(
default
=
''
,
max_length
=
5000
)),
(
'useful_links'
,
backend
.
fields
.
JSONField
(
default
=
list
)),
(
'importance_level'
,
models
.
CharField
(
choices
=
[(
'-'
,
'normal'
),
(
'+'
,
'important'
),
(
'++'
,
'IMPORTANT'
)],
default
=
'-'
,
max_length
=
2
)),
(
'university'
,
models
.
OneToOneField
(
on_delete
=
django
.
db
.
models
.
deletion
.
CASCADE
,
primary_key
=
True
,
related_name
=
'university_semesters_dates'
,
serialize
=
False
,
to
=
'backend.University'
)),
...
...
@@ -737,7 +742,7 @@ class Migration(migrations.Migration):
migrations
.
AddField
(
model_name
=
'countryscholarship'
,
name
=
'currency'
,
field
=
models
.
ForeignKey
(
on_delete
=
django
.
db
.
models
.
deletion
.
PROTECT
,
to
=
'backend.Currency'
),
field
=
models
.
ForeignKey
(
null
=
True
,
on_delete
=
django
.
db
.
models
.
deletion
.
PROTECT
,
to
=
'backend.Currency'
),
),
migrations
.
AddField
(
model_name
=
'countryscholarship'
,
...
...
backend/migrations/0002_auto_20180916_1154.py
deleted
100644 → 0
View file @
a0e5e515
# Generated by Django 2.0.3 on 2018-09-16 09:54
import
django.core.validators
from
django.db
import
migrations
,
models
import
django.db.models.deletion
class
Migration
(
migrations
.
Migration
):
dependencies
=
[
(
'backend'
,
'0001_initial'
),
]
operations
=
[
migrations
.
AddField
(
model_name
=
'countryscholarship'
,
name
=
'other_advantages'
,
field
=
models
.
TextField
(
blank
=
True
,
default
=
''
),
),
migrations
.
AddField
(
model_name
=
'universityscholarship'
,
name
=
'other_advantages'
,
field
=
models
.
TextField
(
blank
=
True
,
default
=
''
),
),
migrations
.
AlterField
(
model_name
=
'countryscholarship'
,
name
=
'amount_max'
,
field
=
models
.
DecimalField
(
decimal_places
=
2
,
max_digits
=
20
,
null
=
True
,
validators
=
[
django
.
core
.
validators
.
MinValueValidator
(
0
)]),
),
migrations
.
AlterField
(
model_name
=
'countryscholarship'
,
name
=
'amount_min'
,
field
=
models
.
DecimalField
(
decimal_places
=
2
,
max_digits
=
20
,
null
=
True
,
validators
=
[
django
.
core
.
validators
.
MinValueValidator
(
0
)]),
),
migrations
.
AlterField
(
model_name
=
'countryscholarship'
,
name
=
'currency'
,
field
=
models
.
ForeignKey
(
null
=
True
,
on_delete
=
django
.
db
.
models
.
deletion
.
PROTECT
,
to
=
'backend.Currency'
),
),
migrations
.
AlterField
(
model_name
=
'universityscholarship'
,
name
=
'amount_max'
,
field
=
models
.
DecimalField
(
decimal_places
=
2
,
max_digits
=
20
,
null
=
True
,
validators
=
[
django
.
core
.
validators
.
MinValueValidator
(
0
)]),
),
migrations
.
AlterField
(
model_name
=
'universityscholarship'
,
name
=
'amount_min'
,
field
=
models
.
DecimalField
(
decimal_places
=
2
,
max_digits
=
20
,
null
=
True
,
validators
=
[
django
.
core
.
validators
.
MinValueValidator
(
0
)]),
),
migrations
.
AlterField
(
model_name
=
'universityscholarship'
,
name
=
'currency'
,
field
=
models
.
ForeignKey
(
null
=
True
,
on_delete
=
django
.
db
.
models
.
deletion
.
PROTECT
,
to
=
'backend.Currency'
),
),
]
backend/migrations/0002_auto_20180916_1555.py
0 → 100644
View file @
7aeec929
# Generated by Django 2.0.3 on 2018-09-16 13:55
import
backend.models.university.university
from
django.db
import
migrations
,
models
class
Migration
(
migrations
.
Migration
):
dependencies
=
[
(
'backend'
,
'0001_initial'
),
]
operations
=
[
migrations
.
AlterField
(
model_name
=
'campus'
,
name
=
'comment'
,
field
=
models
.
CharField
(
blank
=
True
,
default
=
''
,
max_length
=
5000
),
),
migrations
.
AlterField
(
model_name
=
'campus'
,
name
=
'name'
,
field
=
models
.
CharField
(
blank
=
True
,
default
=
''
,
max_length
=
200
),
),
migrations
.
AlterField
(
model_name
=
'campus'
,
name
=
'title'
,
field
=
models
.
CharField
(
blank
=
True
,
default
=
''
,
max_length
=
150
),
),
migrations
.
AlterField
(
model_name
=
'campustaggeditem'
,
name
=
'comment'
,
field
=
models
.
CharField
(
blank
=
True
,
default
=
''
,
max_length
=
5000
),
),
migrations
.
AlterField
(
model_name
=
'campustaggeditem'
,
name
=
'title'
,
field
=
models
.
CharField
(
blank
=
True
,
default
=
''
,
max_length
=
150
),
),
migrations
.
AlterField
(
model_name
=
'city'
,
name
=
'area'
,
field
=
models
.
CharField
(
blank
=
True
,
default
=
''
,
max_length
=
200
),
),
migrations
.
AlterField
(
model_name
=
'city'
,
name
=
'local_name'
,
field
=
models
.
CharField
(
blank
=
True
,
default
=
''
,
max_length
=
200
),
),
migrations
.
AlterField
(
model_name
=
'citytaggeditem'
,
name
=
'comment'
,
field
=
models
.
CharField
(
blank
=
True
,
default
=
''
,
max_length
=
5000
),
),
migrations
.
AlterField
(
model_name
=
'citytaggeditem'
,
name
=
'title'
,
field
=
models
.
CharField
(
blank
=
True
,
default
=
''
,
max_length
=
150
),
),
migrations
.
AlterField
(
model_name
=
'country'
,
name
=
'intermediate_region_name'
,
field
=
models
.
CharField
(
blank
=
True
,
default
=
''
,
max_length
=
200
),
),
migrations
.
AlterField
(
model_name
=
'country'
,
name
=
'intermediate_region_un_code'
,
field
=
models
.
CharField
(
blank
=
True
,
default
=
''
,
max_length
=
3
),
),
migrations
.
AlterField
(
model_name
=
'country'
,
name
=
'iso_alpha3_code'
,
field
=
models
.
CharField
(
blank
=
True
,
default
=
''
,
max_length
=
3
,
unique
=
True
),
),
migrations
.
AlterField
(
model_name
=
'country'
,
name
=
'sub_region_name'
,
field
=
models
.
CharField
(
blank
=
True
,
default
=
''
,
max_length
=
200
),
),
migrations
.
AlterField
(
model_name
=
'country'
,
name
=
'sub_region_un_code'
,
field
=
models
.
CharField
(
blank
=
True
,
default
=
''
,
max_length
=
3
),
),
migrations
.
AlterField
(
model_name
=
'countrydri'
,
name
=
'comment'
,
field
=
models
.
CharField
(
blank
=
True
,
default
=
''
,
max_length
=
5000
),
),
migrations
.
AlterField
(
model_name
=
'countrydri'
,
name
=
'title'
,
field
=
models
.
CharField
(
blank
=
True
,
default
=
''
,
max_length
=
150
),
),
migrations
.
AlterField
(
model_name
=
'countryscholarship'
,
name
=
'comment'
,
field
=
models
.
CharField
(
blank
=
True
,
default
=
''
,
max_length
=
5000
),
),
migrations
.
AlterField
(
model_name
=
'countryscholarship'
,
name
=
'other_advantages'
,
field
=
models
.
CharField
(
blank
=
True
,
default
=
''
,
max_length
=
5000
),
),
migrations
.
AlterField
(
model_name
=
'countryscholarship'
,
name
=
'title'
,
field
=
models
.
CharField
(
blank
=
True
,
default
=
''
,
max_length
=
150
),
),
migrations
.
AlterField
(
model_name
=
'countrytaggeditem'
,
name
=
'comment'
,
field
=
models
.
CharField
(
blank
=
True
,
default
=
''
,
max_length
=
5000
),
),
migrations
.
AlterField
(
model_name
=
'countrytaggeditem'
,
name
=
'title'
,
field
=
models
.
CharField
(
blank
=
True
,
default
=
''
,
max_length
=
150
),
),
migrations
.
AlterField
(
model_name
=
'currency'
,
name
=
'symbol'
,
field
=
models
.
CharField
(
blank
=
True
,
default
=
''
,
max_length
=
30
),
),
migrations
.
AlterField
(
model_name
=
'previousdeparturefeedback'
,
name
=
'adequation_comment'
,
field
=
models
.
CharField
(
blank
=
True
,
default
=
''
,
max_length
=
5000
),
),
migrations
.
AlterField
(
model_name
=
'previousdeparturefeedback'
,
name
=
'integration_comment'
,
field
=
models
.
CharField
(
blank
=
True
,
default
=
''
,
max_length
=
5000
),
),
migrations
.
AlterField
(
model_name
=
'recommendation'
,
name
=
'comment'
,
field
=
models
.
CharField
(
blank
=
True
,
default
=
''
,
max_length
=
5000
),
),
migrations
.
AlterField
(
model_name
=
'university'
,
name
=
'acronym'
,
field
=
models
.
CharField
(
blank
=
True
,
default
=
''
,
max_length
=
20
),
),
migrations
.
AlterField
(
model_name
=
'university'
,
name
=
'logo'
,
field
=
models
.
URLField
(
blank
=
True
,
default
=
''
,
validators
=
[
backend
.
models
.
university
.
university
.
validate_extension_django
]),
),
migrations
.
AlterField
(
model_name
=
'university'
,
name
=
'website'
,
field
=
models
.
URLField
(
blank
=
True
,
default
=
''
,
max_length
=
300
),
),
migrations
.
AlterField
(
model_name
=
'universitydri'
,
name
=
'comment'
,
field
=
models
.
CharField
(
blank
=
True
,
default
=
''
,
max_length
=
5000
),
),
migrations
.
AlterField
(
model_name
=
'universitydri'
,
name
=
'title'
,
field
=
models
.
CharField
(
blank
=
True
,
default
=
''
,
max_length
=
150
),
),
migrations
.
AlterField
(
model_name
=
'universityinfo'
,
name
=
'comment'
,
field
=
models
.
CharField
(
blank
=
True
,
default
=
''
,
max_length
=
5000
),
),
migrations
.
AlterField
(
model_name
=
'universityinfo'
,
name
=
'title'
,
field
=
models
.
CharField
(
blank
=
True
,
default
=
''
,
max_length
=
150
),
),
migrations
.
AlterField
(
model_name
=
'universityscholarship'
,
name
=
'comment'
,
field
=
models
.
CharField
(
blank
=
True
,
default
=
''
,
max_length
=
5000
),
),
migrations
.
AlterField
(
model_name
=
'universityscholarship'
,
name
=
'other_advantages'
,
field
=
models
.
CharField
(
blank
=
True
,
default
=
''
,
max_length
=
5000
),
),
migrations
.
AlterField
(
model_name
=
'universityscholarship'
,
name
=
'title'
,
field
=
models
.
CharField
(
blank
=
True
,
default
=
''
,
max_length
=
150
),
),
migrations
.
AlterField
(
model_name
=
'universitysemestersdates'
,
name
=
'comment'
,
field
=
models
.
CharField
(
blank
=
True
,
default
=
''
,
max_length
=
5000
),
),
migrations
.
AlterField
(
model_name
=
'universitysemestersdates'
,
name
=
'title'
,
field
=
models
.
CharField
(
blank
=
True
,
default
=
''
,
max_length
=
150
),
),
migrations
.
AlterField
(
model_name
=
'universitytaggeditem'
,
name
=
'comment'
,
field
=
models
.
CharField
(
blank
=
True
,
default
=
''
,
max_length
=
5000
),
),
migrations
.
AlterField
(
model_name
=
'universitytaggeditem'
,
name
=
'title'
,
field
=
models
.
CharField
(
blank
=
True
,
default
=
''
,
max_length
=
150
),
),
]
backend/models/abstract/basic_module/basicModule.py
View file @
7aeec929
...
...
@@ -12,8 +12,8 @@ IMPORTANCE_LEVEL = (
class
BasicModule
(
MyModelVersionned
):
title
=
models
.
CharField
(
default
=
""
,
max_length
=
150
)
comment
=
models
.
Text
Field
(
blank
=
True
,
default
=
""
)
title
=
models
.
CharField
(
default
=
''
,
blank
=
True
,
max_length
=
150
)
comment
=
models
.
Char
Field
(
default
=
''
,
blank
=
True
,
max_length
=
5000
)
useful_links
=
JSONField
(
default
=
list
)
importance_level
=
models
.
CharField
(
max_length
=
2
,
...
...
backend/models/abstract/scholarship/scholarship.py
View file @
7aeec929
...
...
@@ -17,7 +17,7 @@ class Scholarship(BasicModule):
type
=
models
.
CharField
(
max_length
=
200
)
currency
=
models
.
ForeignKey
(
Currency
,
null
=
True
,
on_delete
=
models
.
PROTECT
)
other_advantages
=
models
.
Text
Field
(
blank
=
True
,
default
=
""
)
other_advantages
=
models
.
Char
Field
(
default
=
''
,
blank
=
True
,
max_length
=
5000
)
frequency
=
models
.
CharField
(
max_length
=
1
,
...
...
backend/models/campus/campus.py
View file @
7aeec929
from
django.db
import
models
from
backend.models.abstract.
my
_mode
l
import
MyModelVersionned
,
MyModelVersionnedSerializer
,
MyModelVersionned
ViewSet
from
backend.models.abstract.
basic
_mod
ul
e
import
BasicModule
,
BasicModuleSerializer
,
BasicModule
ViewSet
from
backend.models.city
import
City
from
backend.models.university
import
University
from
django.core.validators
import
MinValueValidator
,
MaxValueValidator
from
backend.utils
import
get_model_config
,
get_viewset_permissions
class
Campus
(
MyModelVersionned
):
class
Campus
(
BasicModule
):
model_config
=
get_model_config
(
"Campus"
)
is_main_campus
=
models
.
BooleanField
(
null
=
False
)
name
=
models
.
CharField
(
max_length
=
200
,
null
=
True
)
comment
=
models
.
TextField
(
null
=
True
,
blank
=
True
)
name
=
models
.
CharField
(
max_length
=
200
,
default
=
''
,
blank
=
True
)
city
=
models
.
ForeignKey
(
City
,
on_delete
=
models
.
PROTECT
,
null
=
False
)
university
=
models
.
ForeignKey
(
University
,
on_delete
=
models
.
PROTECT
,
null
=
False
,
related_name
=
"university_campuses"
)
...
...
@@ -41,20 +40,20 @@ class Campus(MyModelVersionned):
unique_together
=
(
'is_main_campus'
,
'university'
)
class
CampusSerializer
(
MyModelVersionned
Serializer
):
class
CampusSerializer
(
BasicModule
Serializer
):
class
Meta
:
model
=
Campus
fields
=
'__all__'
class
CampusViewSet
(
MyModelVersionned
ViewSet
):
class
CampusViewSet
(
BasicModule
ViewSet
):
permission_classes
=
get_viewset_permissions
(
"CampusViewSet"
)
queryset
=
Campus
.
objects
.
all
()
# pylint: disable=E1101
serializer_class
=
CampusSerializer
class
MainCampusViewSet
(
MyModelVersionned
ViewSet
):
class
MainCampusViewSet
(
BasicModule
ViewSet
):
permission_classes
=
get_viewset_permissions
(
"MainCampusViewSet"
)
queryset
=
Campus
.
objects
.
filter
(
is_main_campus
=
True
)
serializer_class
=
CampusSerializer
backend/models/city/city.py
View file @
7aeec929