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
c776e24f
Commit
c776e24f
authored
Sep 09, 2018
by
Florent Chehab
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug corrected and importance level added
parent
9c099cdf
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
62 additions
and
0 deletions
+62
-0
backend/migrations/0002_auto_20180909_1455.py
backend/migrations/0002_auto_20180909_1455.py
+48
-0
backend/models/module/basicModule.py
backend/models/module/basicModule.py
+11
-0
backend/models/module/scholarship.py
backend/models/module/scholarship.py
+1
-0
backend/models/university/universitySemestersDates.py
backend/models/university/universitySemestersDates.py
+2
-0
No files found.
backend/migrations/0002_auto_20180909_1455.py
0 → 100644
View file @
c776e24f
# Generated by Django 2.0.3 on 2018-09-09 12:55
from
django.db
import
migrations
,
models
class
Migration
(
migrations
.
Migration
):
dependencies
=
[
(
'backend'
,
'0001_initial'
),
]
operations
=
[
migrations
.
AddField
(
model_name
=
'campus'
,
name
=
'importance_level'
,
field
=
models
.
CharField
(
choices
=
[(
'-'
,
'normal'
),
(
'+'
,
'important'
),
(
'++'
,
'IMPORTANT'
)],
default
=
'-'
,
max_length
=
2
),
),
migrations
.
AddField
(
model_name
=
'countrydri'
,
name
=
'importance_level'
,
field
=
models
.
CharField
(
choices
=
[(
'-'
,
'normal'
),
(
'+'
,
'important'
),
(
'++'
,
'IMPORTANT'
)],
default
=
'-'
,
max_length
=
2
),
),
migrations
.
AddField
(
model_name
=
'countryscholarship'
,
name
=
'importance_level'
,
field
=
models
.
CharField
(
choices
=
[(
'-'
,
'normal'
),
(
'+'
,
'important'
),
(
'++'
,
'IMPORTANT'
)],
default
=
'-'
,
max_length
=
2
),
),
migrations
.
AddField
(
model_name
=
'universitydri'
,
name
=
'importance_level'
,
field
=
models
.
CharField
(
choices
=
[(
'-'
,
'normal'
),
(
'+'
,
'important'
),
(
'++'
,
'IMPORTANT'
)],
default
=
'-'
,
max_length
=
2
),
),
migrations
.
AddField
(
model_name
=
'universityinfo'
,
name
=
'importance_level'
,
field
=
models
.
CharField
(
choices
=
[(
'-'
,
'normal'
),
(
'+'
,
'important'
),
(
'++'
,
'IMPORTANT'
)],
default
=
'-'
,
max_length
=
2
),
),
migrations
.
AddField
(
model_name
=
'universityscholarship'
,
name
=
'importance_level'
,
field
=
models
.
CharField
(
choices
=
[(
'-'
,
'normal'
),
(
'+'
,
'important'
),
(
'++'
,
'IMPORTANT'
)],
default
=
'-'
,
max_length
=
2
),
),
migrations
.
AddField
(
model_name
=
'universitysemestersdates'
,
name
=
'importance_level'
,
field
=
models
.
CharField
(
choices
=
[(
'-'
,
'normal'
),
(
'+'
,
'important'
),
(
'++'
,
'IMPORTANT'
)],
default
=
'-'
,
max_length
=
2
),
),
]
backend/models/module/basicModule.py
View file @
c776e24f
...
...
@@ -4,11 +4,22 @@ from backend.models.tools import JSONField
from
backend.models.tag.tagged_item_validation
import
validate_content_against_config
from
backend.models.tag.tags_config
import
USEFULL_LINKS_CONFIG
IMPORTANCE_LEVEL
=
(
(
'-'
,
'normal'
),
(
'+'
,
'important'
),
(
'++'
,
'IMPORTANT'
)
)
class
BasicModule
(
MyModelVersionned
):
comment
=
models
.
TextField
(
blank
=
True
)
usefull_links
=
JSONField
(
default
=
list
)
importance_level
=
models
.
CharField
(
max_length
=
2
,
choices
=
IMPORTANCE_LEVEL
,
default
=
'-'
,
)
class
Meta
:
abstract
=
True
...
...
backend/models/module/scholarship.py
View file @
c776e24f
...
...
@@ -28,6 +28,7 @@ class Scholarship(BasicModule):
class
ScholarshipSerializer
(
BasicModuleSerializer
):
def
my_validate
(
self
,
attrs
):
attrs
=
super
(
ScholarshipSerializer
,
self
).
my_validate
(
attrs
)
if
attrs
[
'amount_max'
]
<
attrs
[
'amount_min'
]:
raise
serializers
.
ValidationError
(
"Amount_max should be greater or equal than amount_min"
)
...
...
backend/models/university/universitySemestersDates.py
View file @
c776e24f
...
...
@@ -29,6 +29,8 @@ class UniversitySemestersDates(BasicModule):
class
UniversitySemestersDatesSerializer
(
BasicModuleSerializer
):
def
my_validate
(
self
,
attrs
):
attrs
=
super
(
UniversitySemestersDatesSerializer
,
self
).
my_validate
(
attrs
)
s_b
,
s_e
=
attrs
[
'spring_begin'
],
attrs
[
'spring_end'
]
a_b
,
a_e
=
attrs
[
'autumn_begin'
],
attrs
[
'autumn_end'
]
...
...
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