Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Julien Jerphanion
Rex Dri
Commits
ca658632
Commit
ca658632
authored
Aug 29, 2018
by
Florent Chehab
Browse files
Clean migrations to accelerate testings
Add new unit test that make it fail
parent
f5858327
Changes
31
Hide whitespace changes
Inline
Side-by-side
backend/generate/generate_all.py
View file @
ca658632
...
@@ -3,6 +3,8 @@
...
@@ -3,6 +3,8 @@
from
django
import
template
from
django
import
template
import
yaml
import
yaml
from
os.path
import
join
,
realpath
,
dirname
from
os.path
import
join
,
realpath
,
dirname
from
backend.utils
import
read_file
,
write_file
############
############
# Need to do this first so that Django template engine is working
# Need to do this first so that Django template engine is working
...
@@ -20,16 +22,6 @@ django.setup()
...
@@ -20,16 +22,6 @@ django.setup()
##########
##########
def
read_file
(
file
):
with
open
(
file
,
"r"
)
as
myfile
:
return
myfile
.
read
()
def
write_file
(
file
,
data
):
with
open
(
file
,
'w'
)
as
the_file
:
the_file
.
write
(
data
)
def
render_and_save
(
template_path
,
context
,
output_path
):
def
render_and_save
(
template_path
,
context
,
output_path
):
t
=
template
.
Template
(
read_file
(
template_path
))
t
=
template
.
Template
(
read_file
(
template_path
))
c
=
template
.
Context
({
'data'
:
context
})
c
=
template
.
Context
({
'data'
:
context
})
...
...
backend/migrations/0001_initial.py
View file @
ca658632
# Generated by Django 2.0.3 on 2018-08-2
2 08:1
3
# Generated by Django 2.0.3 on 2018-08-2
9 19:4
3
import
backend.models.tools.usefullLinksField
import
backend.models.tools.usefullLinksField
import
backend.utils.friendly_path
import
backend.utils.friendly_path
...
@@ -14,6 +14,7 @@ class Migration(migrations.Migration):
...
@@ -14,6 +14,7 @@ class Migration(migrations.Migration):
initial
=
True
initial
=
True
dependencies
=
[
dependencies
=
[
(
'contenttypes'
,
'0002_remove_content_type_name'
),
migrations
.
swappable_dependency
(
settings
.
AUTH_USER_MODEL
),
migrations
.
swappable_dependency
(
settings
.
AUTH_USER_MODEL
),
]
]
...
@@ -22,7 +23,10 @@ class Migration(migrations.Migration):
...
@@ -22,7 +23,10 @@ class Migration(migrations.Migration):
name
=
'Campus'
,
name
=
'Campus'
,
fields
=
[
fields
=
[
(
'id'
,
models
.
AutoField
(
auto_created
=
True
,
primary_key
=
True
,
serialize
=
False
,
verbose_name
=
'ID'
)),
(
'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
])),
(
'moderated_on'
,
models
.
DateTimeField
(
null
=
True
)),
(
'updated_on'
,
models
.
DateTimeField
(
null
=
True
)),
(
'usefull_links'
,
backend
.
models
.
tools
.
usefullLinksField
.
UsefullLinksField
(
blank
=
True
,
default
=
list
,
validators
=
[
backend
.
models
.
tools
.
usefullLinksField
.
validate_usefull_links
])),
(
'custom_content'
,
django
.
contrib
.
postgres
.
fields
.
jsonb
.
JSONField
(
blank
=
True
,
default
=
dict
)),
(
'is_main_campus'
,
models
.
BooleanField
()),
(
'is_main_campus'
,
models
.
BooleanField
()),
(
'name'
,
models
.
CharField
(
max_length
=
200
,
null
=
True
)),
(
'name'
,
models
.
CharField
(
max_length
=
200
,
null
=
True
)),
(
'comment'
,
models
.
TextField
(
blank
=
True
,
null
=
True
)),
(
'comment'
,
models
.
TextField
(
blank
=
True
,
null
=
True
)),
...
@@ -34,15 +38,22 @@ class Migration(migrations.Migration):
...
@@ -34,15 +38,22 @@ class Migration(migrations.Migration):
name
=
'City'
,
name
=
'City'
,
fields
=
[
fields
=
[
(
'id'
,
models
.
AutoField
(
auto_created
=
True
,
primary_key
=
True
,
serialize
=
False
,
verbose_name
=
'ID'
)),
(
'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
)),
(
'name'
,
models
.
CharField
(
max_length
=
200
)),
(
'name'
,
models
.
CharField
(
max_length
=
200
)),
(
'local_name'
,
models
.
CharField
(
blank
=
True
,
max_length
=
200
,
null
=
True
)),
(
'local_name'
,
models
.
CharField
(
blank
=
True
,
max_length
=
200
,
null
=
True
)),
(
'area'
,
models
.
CharField
(
blank
=
True
,
max_length
=
200
,
null
=
True
)),
(
'area'
,
models
.
CharField
(
blank
=
True
,
max_length
=
200
,
null
=
True
)),
],
],
options
=
{
'abstract'
:
False
,
},
),
),
migrations
.
CreateModel
(
migrations
.
CreateModel
(
name
=
'CityPhoto'
,
name
=
'CityPhoto'
,
fields
=
[
fields
=
[
(
'id'
,
models
.
AutoField
(
auto_created
=
True
,
primary_key
=
True
,
serialize
=
False
,
verbose_name
=
'ID'
)),
(
'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
)),
(
'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'
))),
(
'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
)),
(
'title'
,
models
.
CharField
(
max_length
=
200
)),
(
'description'
,
models
.
TextField
(
blank
=
True
,
null
=
True
)),
(
'description'
,
models
.
TextField
(
blank
=
True
,
null
=
True
)),
...
@@ -51,6 +62,8 @@ class Migration(migrations.Migration):
...
@@ -51,6 +62,8 @@ class Migration(migrations.Migration):
migrations
.
CreateModel
(
migrations
.
CreateModel
(
name
=
'Country'
,
name
=
'Country'
,
fields
=
[
fields
=
[
(
'moderated_on'
,
models
.
DateTimeField
(
null
=
True
)),
(
'updated_on'
,
models
.
DateTimeField
(
null
=
True
)),
(
'name'
,
models
.
CharField
(
max_length
=
200
)),
(
'name'
,
models
.
CharField
(
max_length
=
200
)),
(
'iso_alpha2_code'
,
models
.
CharField
(
max_length
=
2
,
primary_key
=
True
,
serialize
=
False
)),
(
'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
(
max_length
=
3
,
unique
=
True
)),
...
@@ -61,13 +74,19 @@ class Migration(migrations.Migration):
...
@@ -61,13 +74,19 @@ class Migration(migrations.Migration):
(
'intermediate_region_name'
,
models
.
CharField
(
blank
=
True
,
max_length
=
200
,
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
)),
(
'intermediate_region_un_code'
,
models
.
CharField
(
blank
=
True
,
max_length
=
3
,
null
=
True
)),
],
],
options
=
{
'abstract'
:
False
,
},
),
),
migrations
.
CreateModel
(
migrations
.
CreateModel
(
name
=
'CountryDri'
,
name
=
'CountryDri'
,
fields
=
[
fields
=
[
(
'id'
,
models
.
AutoField
(
auto_created
=
True
,
primary_key
=
True
,
serialize
=
False
,
verbose_name
=
'ID'
)),
(
'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
)),
(
'comment'
,
models
.
TextField
(
blank
=
True
)),
(
'comment'
,
models
.
TextField
(
blank
=
True
)),
(
'usefull_links'
,
backend
.
models
.
tools
.
usefullLinksField
.
UsefullLinksField
(
blank
=
True
,
default
=
[],
validators
=
[
backend
.
models
.
tools
.
usefullLinksField
.
validate_usefull_links
])),
(
'usefull_links'
,
backend
.
models
.
tools
.
usefullLinksField
.
UsefullLinksField
(
blank
=
True
,
default
=
list
,
validators
=
[
backend
.
models
.
tools
.
usefullLinksField
.
validate_usefull_links
])),
(
'custom_content'
,
django
.
contrib
.
postgres
.
fields
.
jsonb
.
JSONField
(
blank
=
True
,
default
=
dict
)),
],
],
options
=
{
options
=
{
'abstract'
:
False
,
'abstract'
:
False
,
...
@@ -77,6 +96,8 @@ class Migration(migrations.Migration):
...
@@ -77,6 +96,8 @@ class Migration(migrations.Migration):
name
=
'CountryPhoto'
,
name
=
'CountryPhoto'
,
fields
=
[
fields
=
[
(
'id'
,
models
.
AutoField
(
auto_created
=
True
,
primary_key
=
True
,
serialize
=
False
,
verbose_name
=
'ID'
)),
(
'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
)),
(
'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'
))),
(
'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
)),
(
'title'
,
models
.
CharField
(
max_length
=
200
)),
(
'description'
,
models
.
TextField
(
blank
=
True
,
null
=
True
)),
(
'description'
,
models
.
TextField
(
blank
=
True
,
null
=
True
)),
...
@@ -86,8 +107,11 @@ class Migration(migrations.Migration):
...
@@ -86,8 +107,11 @@ class Migration(migrations.Migration):
name
=
'CountryScholarship'
,
name
=
'CountryScholarship'
,
fields
=
[
fields
=
[
(
'id'
,
models
.
AutoField
(
auto_created
=
True
,
primary_key
=
True
,
serialize
=
False
,
verbose_name
=
'ID'
)),
(
'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
)),
(
'comment'
,
models
.
TextField
(
blank
=
True
)),
(
'comment'
,
models
.
TextField
(
blank
=
True
)),
(
'usefull_links'
,
backend
.
models
.
tools
.
usefullLinksField
.
UsefullLinksField
(
blank
=
True
,
default
=
[],
validators
=
[
backend
.
models
.
tools
.
usefullLinksField
.
validate_usefull_links
])),
(
'usefull_links'
,
backend
.
models
.
tools
.
usefullLinksField
.
UsefullLinksField
(
blank
=
True
,
default
=
list
,
validators
=
[
backend
.
models
.
tools
.
usefullLinksField
.
validate_usefull_links
])),
(
'custom_content'
,
django
.
contrib
.
postgres
.
fields
.
jsonb
.
JSONField
(
blank
=
True
,
default
=
dict
)),
(
'type'
,
models
.
CharField
(
max_length
=
200
)),
(
'type'
,
models
.
CharField
(
max_length
=
200
)),
(
'amount_min'
,
models
.
DecimalField
(
decimal_places
=
2
,
max_digits
=
20
,
validators
=
[
django
.
core
.
validators
.
MinValueValidator
(
0
)])),
(
'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_max'
,
models
.
DecimalField
(
decimal_places
=
2
,
max_digits
=
20
,
validators
=
[
django
.
core
.
validators
.
MinValueValidator
(
0
)])),
...
@@ -99,51 +123,117 @@ class Migration(migrations.Migration):
...
@@ -99,51 +123,117 @@ class Migration(migrations.Migration):
migrations
.
CreateModel
(
migrations
.
CreateModel
(
name
=
'Currency'
,
name
=
'Currency'
,
fields
=
[
fields
=
[
(
'moderated_on'
,
models
.
DateTimeField
(
null
=
True
)),
(
'updated_on'
,
models
.
DateTimeField
(
null
=
True
)),
(
'code'
,
models
.
CharField
(
max_length
=
15
,
primary_key
=
True
,
serialize
=
False
)),
(
'code'
,
models
.
CharField
(
max_length
=
15
,
primary_key
=
True
,
serialize
=
False
)),
(
'name'
,
models
.
CharField
(
max_length
=
100
)),
(
'name'
,
models
.
CharField
(
max_length
=
100
)),
(
'symbol'
,
models
.
CharField
(
max_length
=
5
)),
(
'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
)])),
(
'one_USD_in_this_currency'
,
models
.
DecimalField
(
decimal_places
=
6
,
max_digits
=
20
,
validators
=
[
django
.
core
.
validators
.
MinValueValidator
(
0
)])),
(
'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
)),
],
],
options
=
{
'abstract'
:
False
,
},
),
),
migrations
.
CreateModel
(
migrations
.
CreateModel
(
name
=
'Department'
,
name
=
'Department'
,
fields
=
[
fields
=
[
(
'moderated_on'
,
models
.
DateTimeField
(
null
=
True
)),
(
'updated_on'
,
models
.
DateTimeField
(
null
=
True
)),
(
'code'
,
models
.
CharField
(
max_length
=
6
,
primary_key
=
True
,
serialize
=
False
)),
(
'code'
,
models
.
CharField
(
max_length
=
6
,
primary_key
=
True
,
serialize
=
False
)),
(
'name'
,
models
.
CharField
(
max_length
=
100
)),
(
'name'
,
models
.
CharField
(
max_length
=
100
)),
(
'active'
,
models
.
BooleanField
()),
(
'active'
,
models
.
BooleanField
()),
(
'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
)),
],
],
options
=
{
'abstract'
:
False
,
},
),
migrations
.
CreateModel
(
name
=
'ForTestingModeration'
,
fields
=
[
(
'id'
,
models
.
AutoField
(
auto_created
=
True
,
primary_key
=
True
,
serialize
=
False
,
verbose_name
=
'ID'
)),
(
'moderated_on'
,
models
.
DateTimeField
(
null
=
True
)),
(
'updated_on'
,
models
.
DateTimeField
(
null
=
True
)),
(
'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
)),
],
options
=
{
'abstract'
:
False
,
},
),
migrations
.
CreateModel
(
name
=
'ForTestingVersioning'
,
fields
=
[
(
'id'
,
models
.
AutoField
(
auto_created
=
True
,
primary_key
=
True
,
serialize
=
False
,
verbose_name
=
'ID'
)),
(
'moderated_on'
,
models
.
DateTimeField
(
null
=
True
)),
(
'updated_on'
,
models
.
DateTimeField
(
null
=
True
)),
(
'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
)),
],
options
=
{
'abstract'
:
False
,
},
),
),
migrations
.
CreateModel
(
migrations
.
CreateModel
(
name
=
'Offer'
,
name
=
'Offer'
,
fields
=
[
fields
=
[
(
'id'
,
models
.
AutoField
(
auto_created
=
True
,
primary_key
=
True
,
serialize
=
False
,
verbose_name
=
'ID'
)),
(
'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
)),
(
'nb_seats_offered'
,
models
.
PositiveIntegerField
()),
(
'nb_seats_offered'
,
models
.
PositiveIntegerField
()),
(
'nb_seats_offered_exchange'
,
models
.
PositiveIntegerField
(
null
=
True
)),
(
'nb_seats_offered_exchange'
,
models
.
PositiveIntegerField
(
null
=
True
)),
(
'nb_seats_offered_double_degree'
,
models
.
PositiveIntegerField
(
null
=
True
)),
(
'nb_seats_offered_double_degree'
,
models
.
PositiveIntegerField
(
null
=
True
)),
(
'moderated_by'
,
models
.
ForeignKey
(
null
=
True
,
on_delete
=
django
.
db
.
models
.
deletion
.
SET_NULL
,
related_name
=
'+'
,
to
=
settings
.
AUTH_USER_MODEL
)),
],
),
migrations
.
CreateModel
(
name
=
'PendingModeration'
,
fields
=
[
(
'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
)),
(
'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
)),
],
],
),
),
migrations
.
CreateModel
(
migrations
.
CreateModel
(
name
=
'PreviousDeparture'
,
name
=
'PreviousDeparture'
,
fields
=
[
fields
=
[
(
'id'
,
models
.
AutoField
(
auto_created
=
True
,
primary_key
=
True
,
serialize
=
False
,
verbose_name
=
'ID'
)),
(
'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
)),
(
'Utc_departure_id'
,
models
.
IntegerField
()),
(
'Utc_departure_id'
,
models
.
IntegerField
()),
(
'is_anonymous'
,
models
.
BooleanField
()),
(
'is_anonymous'
,
models
.
BooleanField
()),
(
'courses'
,
django
.
contrib
.
postgres
.
fields
.
jsonb
.
JSONField
(
null
=
True
)),
(
'courses'
,
django
.
contrib
.
postgres
.
fields
.
jsonb
.
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
=
{
'abstract'
:
False
,
},
),
),
migrations
.
CreateModel
(
migrations
.
CreateModel
(
name
=
'PreviousDepartureFeedback'
,
name
=
'PreviousDepartureFeedback'
,
fields
=
[
fields
=
[
(
'id'
,
models
.
AutoField
(
auto_created
=
True
,
primary_key
=
True
,
serialize
=
False
,
verbose_name
=
'ID'
)),
(
'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
)),
(
'is_anonymous'
,
models
.
BooleanField
(
default
=
True
)),
(
'is_anonymous'
,
models
.
BooleanField
(
default
=
True
)),
(
'is_public'
,
models
.
BooleanField
(
default
=
False
)),
(
'is_public'
,
models
.
BooleanField
(
default
=
False
)),
(
'courses_and_courses_feedback'
,
django
.
contrib
.
postgres
.
fields
.
jsonb
.
JSONField
(
null
=
True
)),
(
'courses_and_courses_feedback'
,
django
.
contrib
.
postgres
.
fields
.
jsonb
.
JSONField
(
default
=
dict
)),
(
'adequation_comment'
,
models
.
TextField
()),
(
'adequation_comment'
,
models
.
TextField
()),
(
'integration_comment'
,
models
.
TextField
()),
(
'integration_comment'
,
models
.
TextField
()),
(
'adequation_grate'
,
models
.
PositiveIntegerField
(
validators
=
[
django
.
core
.
validators
.
MaxValueValidator
(
20
)])),
(
'adequation_grate'
,
models
.
PositiveIntegerField
(
validators
=
[
django
.
core
.
validators
.
MaxValueValidator
(
20
)])),
(
'integration_grade'
,
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'
)),
(
'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
)),
(
'moderated_by'
,
models
.
ForeignKey
(
null
=
True
,
on_delete
=
django
.
db
.
models
.
deletion
.
SET_NULL
,
related_name
=
'+'
,
to
=
settings
.
AUTH_USER_MODEL
)),
(
'owner'
,
models
.
ForeignKey
(
on_delete
=
django
.
db
.
models
.
deletion
.
CASCADE
,
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
)),
],
],
options
=
{
options
=
{
'abstract'
:
False
,
'abstract'
:
False
,
...
@@ -153,44 +243,80 @@ class Migration(migrations.Migration):
...
@@ -153,44 +243,80 @@ class Migration(migrations.Migration):
name
=
'Recommendation'
,
name
=
'Recommendation'
,
fields
=
[
fields
=
[
(
'id'
,
models
.
AutoField
(
auto_created
=
True
,
primary_key
=
True
,
serialize
=
False
,
verbose_name
=
'ID'
)),
(
'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
)),
(
'is_anonymous'
,
models
.
BooleanField
(
default
=
True
)),
(
'is_anonymous'
,
models
.
BooleanField
(
default
=
True
)),
(
'is_public'
,
models
.
BooleanField
(
default
=
False
)),
(
'is_public'
,
models
.
BooleanField
(
default
=
False
)),
(
'order_in_list'
,
models
.
PositiveIntegerField
()),
(
'order_in_list'
,
models
.
PositiveIntegerField
()),
(
'comment'
,
models
.
TextField
(
blank
=
True
,
null
=
True
)),
(
'comment'
,
models
.
TextField
(
blank
=
True
,
null
=
True
)),
(
'grade'
,
models
.
PositiveIntegerField
(
null
=
True
,
validators
=
[
django
.
core
.
validators
.
MaxValueValidator
(
20
)])),
(
'grade'
,
models
.
PositiveIntegerField
(
null
=
True
,
validators
=
[
django
.
core
.
validators
.
MaxValueValidator
(
20
)])),
(
'moderated_by'
,
models
.
ForeignKey
(
null
=
True
,
on_delete
=
django
.
db
.
models
.
deletion
.
SET_NULL
,
related_name
=
'+'
,
to
=
settings
.
AUTH_USER_MODEL
)),
(
'owner'
,
models
.
ForeignKey
(
on_delete
=
django
.
db
.
models
.
deletion
.
CASCADE
,
to
=
settings
.
AUTH_USER_MODEL
)),
],
],
),
),
migrations
.
CreateModel
(
migrations
.
CreateModel
(
name
=
'RecommendationList'
,
name
=
'RecommendationList'
,
fields
=
[
fields
=
[
(
'id'
,
models
.
AutoField
(
auto_created
=
True
,
primary_key
=
True
,
serialize
=
False
,
verbose_name
=
'ID'
)),
(
'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
)),
(
'is_anonymous'
,
models
.
BooleanField
(
default
=
True
)),
(
'is_anonymous'
,
models
.
BooleanField
(
default
=
True
)),
(
'is_public'
,
models
.
BooleanField
(
default
=
False
)),
(
'is_public'
,
models
.
BooleanField
(
default
=
False
)),
(
'public'
,
models
.
BooleanField
()),
(
'public'
,
models
.
BooleanField
()),
(
'title'
,
models
.
CharField
(
max_length
=
200
)),
(
'title'
,
models
.
CharField
(
max_length
=
200
)),
(
'user'
,
models
.
ForeignKey
(
on_delete
=
django
.
db
.
models
.
deletion
.
CASCADE
,
to
=
settings
.
AUTH_USER_MODEL
)),
(
'moderated_by'
,
models
.
ForeignKey
(
null
=
True
,
on_delete
=
django
.
db
.
models
.
deletion
.
SET_NULL
,
related_name
=
'+'
,
to
=
settings
.
AUTH_USER_MODEL
)),
(
'owner'
,
models
.
ForeignKey
(
on_delete
=
django
.
db
.
models
.
deletion
.
CASCADE
,
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
)),
],
],
),
),
migrations
.
CreateModel
(
migrations
.
CreateModel
(
name
=
'Semester'
,
name
=
'Semester'
,
fields
=
[
fields
=
[
(
'moderated_on'
,
models
.
DateTimeField
(
null
=
True
)),
(
'updated_on'
,
models
.
DateTimeField
(
null
=
True
)),
(
'code'
,
models
.
CharField
(
max_length
=
6
,
primary_key
=
True
,
serialize
=
False
)),
(
'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
)),
],
],
options
=
{
'abstract'
:
False
,
},
),
),
migrations
.
CreateModel
(
migrations
.
CreateModel
(
name
=
'Specialty'
,
name
=
'Specialty'
,
fields
=
[
fields
=
[
(
'id'
,
models
.
AutoField
(
auto_created
=
True
,
primary_key
=
True
,
serialize
=
False
,
verbose_name
=
'ID'
)),
(
'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
)),
(
'code'
,
models
.
CharField
(
max_length
=
6
)),
(
'code'
,
models
.
CharField
(
max_length
=
6
)),
(
'name'
,
models
.
CharField
(
max_length
=
100
)),
(
'name'
,
models
.
CharField
(
max_length
=
100
)),
(
'active'
,
models
.
BooleanField
()),
(
'active'
,
models
.
BooleanField
()),
(
'department'
,
models
.
ForeignKey
(
on_delete
=
django
.
db
.
models
.
deletion
.
PROTECT
,
to
=
'backend.Department'
)),
(
'department'
,
models
.
ForeignKey
(
on_delete
=
django
.
db
.
models
.
deletion
.
PROTECT
,
to
=
'backend.Department'
)),
(
'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
)),
],
),
migrations
.
CreateModel
(
name
=
'Tag'
,
fields
=
[
(
'id'
,
models
.
AutoField
(
auto_created
=
True
,
primary_key
=
True
,
serialize
=
False
,
verbose_name
=
'ID'
)),
(
'moderated_on'
,
models
.
DateTimeField
(
null
=
True
)),
(
'updated_on'
,
models
.
DateTimeField
(
null
=
True
)),
(
'name'
,
models
.
CharField
(
max_length
=
100
)),
(
'config'
,
django
.
contrib
.
postgres
.
fields
.
jsonb
.
JSONField
(
blank
=
True
,
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
)),
],
],
options
=
{
'abstract'
:
False
,
},
),
),
migrations
.
CreateModel
(
migrations
.
CreateModel
(
name
=
'University'
,
name
=
'University'
,
fields
=
[
fields
=
[
(
'id'
,
models
.
AutoField
(
auto_created
=
True
,
primary_key
=
True
,
serialize
=
False
,
verbose_name
=
'ID'
)),
(
'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
)),
(
'name'
,
models
.
CharField
(
max_length
=
200
)),
(
'name'
,
models
.
CharField
(
max_length
=
200
)),
(
'acronym'
,
models
.
CharField
(
blank
=
True
,
max_length
=
20
,
null
=
True
)),
(
'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'
))),
(
'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'
))),
...
@@ -204,8 +330,12 @@ class Migration(migrations.Migration):
...
@@ -204,8 +330,12 @@ class Migration(migrations.Migration):
name
=
'UniversityDri'
,
name
=
'UniversityDri'
,
fields
=
[
fields
=
[
(
'id'
,
models
.
AutoField
(
auto_created
=
True
,
primary_key
=
True
,
serialize
=
False
,
verbose_name
=
'ID'
)),
(
'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
)),
(
'comment'
,
models
.
TextField
(
blank
=
True
)),
(
'comment'
,
models
.
TextField
(
blank
=
True
)),
(
'usefull_links'
,
backend
.
models
.
tools
.
usefullLinksField
.
UsefullLinksField
(
blank
=
True
,
default
=
[],
validators
=
[
backend
.
models
.
tools
.
usefullLinksField
.
validate_usefull_links
])),
(
'usefull_links'
,
backend
.
models
.
tools
.
usefullLinksField
.
UsefullLinksField
(
blank
=
True
,
default
=
list
,
validators
=
[
backend
.
models
.
tools
.
usefullLinksField
.
validate_usefull_links
])),
(
'custom_content'
,
django
.
contrib
.
postgres
.
fields
.
jsonb
.
JSONField
(
blank
=
True
,
default
=
dict
)),
(
'moderated_by'
,
models
.
ForeignKey
(
null
=
True
,
on_delete
=
django
.
db
.
models
.
deletion
.
SET_NULL
,
related_name
=
'+'
,
to
=
settings
.
AUTH_USER_MODEL
)),
],
],
options
=
{
options
=
{
'abstract'
:
False
,
'abstract'
:
False
,
...
@@ -215,21 +345,28 @@ class Migration(migrations.Migration):
...
@@ -215,21 +345,28 @@ class Migration(migrations.Migration):
name
=
'UniversityPhoto'
,
name
=
'UniversityPhoto'
,
fields
=
[
fields
=
[
(
'id'
,
models
.
AutoField
(
auto_created
=
True
,
primary_key
=
True
,
serialize
=
False
,
verbose_name
=
'ID'
)),
(
'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
)),
(
'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'
))),
(
'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
)),
(
'title'
,
models
.
CharField
(
max_length
=
200
)),
(
'description'
,
models
.
TextField
(
blank
=
True
,
null
=
True
)),
(
'description'
,
models
.
TextField
(
blank
=
True
,
null
=
True
)),
(
'moderated_by'
,
models
.
ForeignKey
(
null
=
True
,
on_delete
=
django
.
db
.
models
.
deletion
.
SET_NULL
,
related_name
=
'+'
,
to
=
settings
.
AUTH_USER_MODEL
)),
],
],
),
),
migrations
.
CreateModel
(
migrations
.
CreateModel
(
name
=
'UniversityScholarship'
,
name
=
'UniversityScholarship'
,
fields
=
[
fields
=
[
(
'id'
,
models
.
AutoField
(
auto_created
=
True
,
primary_key
=
True
,
serialize
=
False
,
verbose_name
=
'ID'
)),
(
'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
)),
(
'comment'
,
models
.
TextField
(
blank
=
True
)),
(
'comment'
,
models
.
TextField
(
blank
=
True
)),
(
'usefull_links'
,
backend
.
models
.
tools
.
usefullLinksField
.
UsefullLinksField
(
blank
=
True
,
default
=
[],
validators
=
[
backend
.
models
.
tools
.
usefullLinksField
.
validate_usefull_links
])),
(
'usefull_links'
,
backend
.
models
.
tools
.
usefullLinksField
.
UsefullLinksField
(
blank
=
True
,
default
=
list
,
validators
=
[
backend
.
models
.
tools
.
usefullLinksField
.
validate_usefull_links
])),
(
'custom_content'
,
django
.
contrib
.
postgres
.
fields
.
jsonb
.
JSONField
(
blank
=
True
,
default
=
dict
)),
(
'type'
,
models
.
CharField
(
max_length
=
200
)),
(
'type'
,
models
.
CharField
(
max_length
=
200
)),
(
'amount_min'
,
models
.
DecimalField
(
decimal_places
=
2
,
max_digits
=
20
,
validators
=
[
django
.
core
.
validators
.
MinValueValidator
(
0
)])),
(
'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_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'
)),
(
'currency'
,
models
.
ForeignKey
(
on_delete
=
django
.
db
.
models
.
deletion
.
PROTECT
,
to
=
'backend.Currency'
)),
(
'moderated_by'
,
models
.
ForeignKey
(
null
=
True
,
on_delete
=
django
.
db
.
models
.
deletion
.
SET_NULL
,
related_name
=
'+'
,
to
=
settings
.
AUTH_USER_MODEL
)),
],
],
options
=
{
options
=
{
'abstract'
:
False
,
'abstract'
:
False
,
...
@@ -239,225 +376,73 @@ class Migration(migrations.Migration):
...
@@ -239,225 +376,73 @@ class Migration(migrations.Migration):
name
=
'UserData'
,
name
=
'UserData'
,
fields
=
[
fields
=
[
(
'id'
,
models
.
AutoField
(
auto_created
=
True
,
primary_key
=
True
,
serialize
=
False
,
verbose_name
=
'ID'
)),
(
'id'
,
models
.
AutoField
(
auto_created
=
True
,
primary_key
=
True
,
serialize
=
False
,
verbose_name
=
'ID'
)),
(
'
is_anonymous
'
,
models
.
Boolean
Field
(
defa
ul
t
=
True
)),
(
'
moderated_on
'
,
models
.
DateTime
Field
(
n
ul
l
=
True
)),
(
'
is_public'
,
models
.
BooleanField
(
default
=
Fals
e
)),
(
'
updated_on'
,
models
.
DateTimeField
(
null
=
Tru
e
)),
(
'contact_info'
,
backend
.
models
.
tools
.
usefullLinksField
.
UsefullLinksField
(
default
=
[],
null
=
True
,
validators
=
[
backend
.
models
.
tools
.
usefullLinksField
.
validate_usefull_links
]
)),
(
'contact_info'
,
django
.
contrib
.
postgres
.
fields
.
jsonb
.
JSONField
(
default
=
dict
)),
(
'contact_info_is_public'
,
models
.
BooleanField
(
default
=
False
)),
(
'contact_info_is_public'
,
models
.
BooleanField
(
default
=
False
)),
(
'config'
,
django
.
contrib
.
postgres
.
fields
.
jsonb
.
JSONField
(
default
=
{},
null
=
True
)),
(
'config'
,
django
.
contrib
.
postgres
.
fields
.
jsonb
.
JSONField
(
default
=
dict
)),
(
'other_data'
,
django
.
contrib
.
postgres
.
fields
.
jsonb
.
JSONField
(
default
=
{},
null
=
True
)),
(
'other_data'
,
django
.
contrib
.
postgres
.
fields
.
jsonb
.
JSONField
(
default
=
dict
)),
(
'user'
,
models
.
ForeignKey
(
on_delete
=
django
.
db
.
models
.
deletion
.
CASCADE
,
to
=
settings
.
AUTH_USER_MODEL
)),
],
options
=
{
'abstract'
:
False
,
},