Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Rex Dri
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
32
Issues
32
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Rex Dri
Rex Dri
Commits
7aeec929
Commit
7aeec929
authored
Sep 16, 2018
by
Florent Chehab
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Small update on backend texts fields
parent
a0e5e515
Changes
12
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
271 additions
and
113 deletions
+271
-113
backend/migrations/0001_initial.py
backend/migrations/0001_initial.py
+39
-34
backend/migrations/0002_auto_20180916_1154.py
backend/migrations/0002_auto_20180916_1154.py
+0
-55
backend/migrations/0002_auto_20180916_1555.py
backend/migrations/0002_auto_20180916_1555.py
+209
-0
backend/models/abstract/basic_module/basicModule.py
backend/models/abstract/basic_module/basicModule.py
+2
-2
backend/models/abstract/scholarship/scholarship.py
backend/models/abstract/scholarship/scholarship.py
+1
-1
backend/models/campus/campus.py
backend/models/campus/campus.py
+6
-7
backend/models/city/city.py
backend/models/city/city.py
+2
-2
backend/models/country/country.py
backend/models/country/country.py
+5
-5
backend/models/currency/currency.py
backend/models/currency/currency.py
+1
-1
backend/models/university/university.py
backend/models/university/university.py
+3
-3
backend/models/user/previousDepartureFeedback.py
backend/models/user/previousDepartureFeedback.py
+2
-2
backend/models/user/recommendation.py
backend/models/user/recommendation.py
+1
-1
No files found.
backend/migrations/0001_initial.py
View file @
7aeec929
This diff is collapsed.
Click to expand it.
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
.
TextField
(
blank
=
True
,
default
=
""
)
title
=
models
.
CharField
(
default
=
''
,
blank
=
True
,
max_length
=
150
)
comment
=
models
.
CharField
(
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
.
TextField
(
blank
=
True
,
default
=
""
)
other_advantages
=
models
.
CharField
(
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_model
import
MyModelVersionned
,
MyModelVersionnedSerializer
,
MyModelVersionned
ViewSet
from
backend.models.abstract.
basic_module
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
...
...
@@ -8,10 +8,10 @@ class City(MyModel):
model_config
=
get_model_config
(
"City"
)
name
=
models
.
CharField
(
max_length
=
200
)
local_name
=
models
.
CharField
(
max_length
=
200
,
null
=
True
,
blank
=
True
)
local_name
=
models
.
CharField
(
max_length
=
200
,
default
=
''
,
blank
=
True
)
# We add an area to distinguish similarly named cities
# in a country
area
=
models
.
CharField
(
max_length
=
200
,
null
=
True
,
blank
=
True
)
area
=
models
.
CharField
(
max_length
=
200
,
default
=
''
,
blank
=
True
)
country
=
models
.
ForeignKey
(
Country
,
on_delete
=
models
.
PROTECT
)
...
...
backend/models/country/country.py
View file @
7aeec929
...
...
@@ -10,15 +10,15 @@ class Country(MyModel):
name
=
models
.
CharField
(
max_length
=
200
)
iso_alpha2_code
=
models
.
CharField
(
primary_key
=
True
,
max_length
=
2
)
iso_alpha3_code
=
models
.
CharField
(
unique
=
True
,
max_length
=
3
,
blank
=
False
,
null
=
Fals
e
)
unique
=
True
,
max_length
=
3
,
default
=
''
,
blank
=
Tru
e
)
region_name
=
models
.
CharField
(
max_length
=
200
)
region_un_code
=
models
.
CharField
(
max_length
=
3
)
sub_region_name
=
models
.
CharField
(
max_length
=
200
,
null
=
True
,
blank
=
True
)
sub_region_un_code
=
models
.
CharField
(
max_length
=
3
,
null
=
True
,
blank
=
True
)
sub_region_name
=
models
.
CharField
(
max_length
=
200
,
default
=
''
,
blank
=
True
)
sub_region_un_code
=
models
.
CharField
(
max_length
=
3
,
default
=
''
,
blank
=
True
)
intermediate_region_name
=
models
.
CharField
(
max_length
=
200
,
null
=
True
,
blank
=
True
)
max_length
=
200
,
default
=
''
,
blank
=
True
)
intermediate_region_un_code
=
models
.
CharField
(
max_length
=
3
,
null
=
True
,
blank
=
True
)
max_length
=
3
,
default
=
''
,
blank
=
True
)
class
CountrySerializer
(
MyModelSerializer
):
...
...
backend/models/currency/currency.py
View file @
7aeec929
...
...
@@ -9,7 +9,7 @@ class Currency(MyModel):
code
=
models
.
CharField
(
primary_key
=
True
,
max_length
=
3
)
name
=
models
.
CharField
(
max_length
=
100
)
symbol
=
models
.
CharField
(
null
=
True
,
blank
=
True
,
max_length
=
30
)
symbol
=
models
.
CharField
(
default
=
''
,
blank
=
True
,
max_length
=
30
)
one_EUR_in_this_currency
=
models
.
DecimalField
(
max_digits
=
20
,
decimal_places
=
6
,
...
...
backend/models/university/university.py
View file @
7aeec929
...
...
@@ -24,10 +24,10 @@ class University(MyModel):
model_config
=
get_model_config
(
"University"
)
name
=
models
.
CharField
(
max_length
=
200
)
acronym
=
models
.
CharField
(
max_length
=
20
,
null
=
True
,
blank
=
True
)
logo
=
models
.
URLField
(
null
=
True
,
blank
=
True
,
validators
=
[
acronym
=
models
.
CharField
(
max_length
=
20
,
default
=
''
,
blank
=
True
)
logo
=
models
.
URLField
(
default
=
''
,
blank
=
True
,
validators
=
[
validate_extension_django
])
website
=
models
.
URLField
(
null
=
True
,
blank
=
True
,
max_length
=
300
)
website
=
models
.
URLField
(
default
=
''
,
blank
=
True
,
max_length
=
300
)
utc_id
=
models
.
IntegerField
(
unique
=
True
)
...
...
backend/models/user/previousDepartureFeedback.py
View file @
7aeec929
...
...
@@ -13,8 +13,8 @@ class PreviousDepartureFeedback(UserRestrictedModule):
PreviousDeparture
,
on_delete
=
models
.
CASCADE
)
courses_and_courses_feedback
=
JSONField
(
default
=
dict
)
adequation_comment
=
models
.
TextField
(
)
integration_comment
=
models
.
TextField
(
)
adequation_comment
=
models
.
CharField
(
default
=
''
,
blank
=
True
,
max_length
=
5000
)
integration_comment
=
models
.
CharField
(
default
=
''
,
blank
=
True
,
max_length
=
5000
)
adequation_grate
=
models
.
PositiveIntegerField
(
validators
=
[
MaxValueValidator
(
20
)])
integration_grade
=
models
.
PositiveIntegerField
(
...
...
backend/models/user/recommendation.py
View file @
7aeec929
...
...
@@ -17,7 +17,7 @@ class Recommendation(UserRestrictedModule):
specialty
=
models
.
ForeignKey
(
Specialty
,
on_delete
=
models
.
PROTECT
)
order_in_list
=
models
.
PositiveIntegerField
()
comment
=
models
.
TextField
(
null
=
True
,
blank
=
True
)
comment
=
models
.
CharField
(
default
=
''
,
blank
=
True
,
max_length
=
5000
)
grade
=
models
.
PositiveIntegerField
(
null
=
True
,
validators
=
[
MaxValueValidator
(
20
)])
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment