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
9743527c
Commit
9743527c
authored
Sep 10, 2018
by
Florent Chehab
Browse files
Fixed models and add frequency to scholarship
parent
0204a094
Changes
4
Hide whitespace changes
Inline
Side-by-side
backend/migrations/0004_auto_20180910_1834.py
0 → 100644
View file @
9743527c
# Generated by Django 2.0.3 on 2018-09-10 16:34
from
django.db
import
migrations
,
models
import
django.db.models.deletion
class
Migration
(
migrations
.
Migration
):
dependencies
=
[
(
'backend'
,
'0003_auto_20180910_1731'
),
]
operations
=
[
migrations
.
AlterField
(
model_name
=
'universityinfo'
,
name
=
'costs_currency'
,
field
=
models
.
ForeignKey
(
default
=
'EUR'
,
on_delete
=
django
.
db
.
models
.
deletion
.
PROTECT
,
to
=
'backend.Currency'
),
),
]
backend/migrations/0005_auto_20180910_1846.py
0 → 100644
View file @
9743527c
# Generated by Django 2.0.3 on 2018-09-10 16:46
from
django.db
import
migrations
,
models
class
Migration
(
migrations
.
Migration
):
dependencies
=
[
(
'backend'
,
'0004_auto_20180910_1834'
),
]
operations
=
[
migrations
.
AddField
(
model_name
=
'countryscholarship'
,
name
=
'frequency'
,
field
=
models
.
CharField
(
choices
=
[(
'w'
,
'week'
),
(
'm'
,
'month'
),
(
's'
,
'semester'
),
(
'y'
,
'year'
),
(
'o'
,
'one_shot'
)],
default
=
'm'
,
max_length
=
1
),
),
migrations
.
AddField
(
model_name
=
'universityscholarship'
,
name
=
'frequency'
,
field
=
models
.
CharField
(
choices
=
[(
'w'
,
'week'
),
(
'm'
,
'month'
),
(
's'
,
'semester'
),
(
'y'
,
'year'
),
(
'o'
,
'one_shot'
)],
default
=
'm'
,
max_length
=
1
),
),
]
backend/models/abstract/scholarship/scholarship.py
View file @
9743527c
...
...
@@ -4,11 +4,25 @@ from backend.models.currency import Currency
from
rest_framework
import
serializers
from
django.core.validators
import
MinValueValidator
SCHOLARSHIP_FREQUENCIES
=
(
(
'w'
,
'week'
),
(
'm'
,
'month'
),
(
's'
,
'semester'
),
(
'y'
,
'year'
),
(
'o'
,
'one_shot'
)
)
class
Scholarship
(
BasicModule
):
type
=
models
.
CharField
(
max_length
=
200
)
currency
=
models
.
ForeignKey
(
Currency
,
on_delete
=
models
.
PROTECT
)
frequency
=
models
.
CharField
(
max_length
=
1
,
choices
=
SCHOLARSHIP_FREQUENCIES
,
default
=
'm'
,
)
amount_min
=
models
.
DecimalField
(
max_digits
=
20
,
decimal_places
=
2
,
...
...
backend/models/university/universityInfo.py
View file @
9743527c
...
...
@@ -26,7 +26,7 @@ class UniversityInfo(BasicModule):
null
=
True
)
costs_currency
=
models
.
ForeignKey
(
Currency
,
on_delete
=
models
.
PROTECT
)
costs_currency
=
models
.
ForeignKey
(
Currency
,
on_delete
=
models
.
PROTECT
,
default
=
'EUR'
)
@
classmethod
def
get_serializer
(
cls
):
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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