Fakultas Ilmu Komputer UI
Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
PMPL
Class Project
Kape
Commits
e94df367
Commit
e94df367
authored
Dec 03, 2019
by
Muhammad Fauzan Fikri
Browse files
add migrations
parent
003cdc07
Changes
5
Hide whitespace changes
Inline
Side-by-side
core/migrations/0001_initial.py
View file @
e94df367
# -*- coding: utf-8 -*-
# -*- coding: utf-8 -*-
# Generated by Django 1.11.17 on 2019-1
1-16 08:22
# Generated by Django 1.11.17 on 2019-1
2-03 03:38
from
__future__
import
unicode_literals
from
__future__
import
unicode_literals
import
core.lib.validators
import
core.lib.validators
...
@@ -34,12 +34,12 @@ class Migration(migrations.Migration):
...
@@ -34,12 +34,12 @@ class Migration(migrations.Migration):
(
'created'
,
models
.
DateTimeField
(
auto_now_add
=
True
)),
(
'created'
,
models
.
DateTimeField
(
auto_now_add
=
True
)),
(
'updated'
,
models
.
DateTimeField
(
auto_now
=
True
)),
(
'updated'
,
models
.
DateTimeField
(
auto_now
=
True
)),
(
'description'
,
models
.
TextField
()),
(
'description'
,
models
.
TextField
()),
(
'status'
,
models
.
IntegerField
(
default
=
0
)),
(
'status'
,
models
.
IntegerField
(
default
=
0
,
validators
=
[
django
.
core
.
validators
.
MaxValueValidator
(
2
),
django
.
core
.
validators
.
MinValueValidator
(
0
)]
)),
(
'logo'
,
models
.
FileField
(
blank
=
True
,
null
=
True
,
upload_to
=
core
.
models
.
accounts
.
get_company_logo_file_path
,
validators
=
[
core
.
lib
.
validators
.
validate_image_file_extension
])),
(
'logo'
,
models
.
FileField
(
blank
=
True
,
null
=
True
,
upload_to
=
core
.
models
.
accounts
.
get_company_logo_file_path
,
validators
=
[
core
.
lib
.
validators
.
validate_image_file_extension
])),
(
'address'
,
models
.
CharField
(
blank
=
True
,
max_length
=
1000
,
null
=
True
)),
(
'address'
,
models
.
CharField
(
blank
=
True
,
max_length
=
1000
,
null
=
True
)),
(
'category'
,
models
.
CharField
(
default
=
b
'Belum ada kategori perusahaan'
,
max_length
=
140
)),
(
'category'
,
models
.
CharField
(
default
=
'Belum ada kategori perusahaan'
,
max_length
=
140
)),
(
'size'
,
models
.
CharField
(
blank
=
True
,
default
=
0
,
max_length
=
10
,
null
=
True
)),
(
'size'
,
models
.
CharField
(
blank
=
True
,
default
=
0
,
max_length
=
10
,
null
=
True
)),
(
'website'
,
models
.
CharField
(
default
=
b
'Belum ada link website'
,
max_length
=
100
)),
(
'website'
,
models
.
CharField
(
default
=
'Belum ada link website'
,
max_length
=
100
)),
(
'linkedin_url'
,
models
.
URLField
(
blank
=
True
,
null
=
True
)),
(
'linkedin_url'
,
models
.
URLField
(
blank
=
True
,
null
=
True
)),
(
'user'
,
models
.
OneToOneField
(
on_delete
=
django
.
db
.
models
.
deletion
.
CASCADE
,
to
=
settings
.
AUTH_USER_MODEL
)),
(
'user'
,
models
.
OneToOneField
(
on_delete
=
django
.
db
.
models
.
deletion
.
CASCADE
,
to
=
settings
.
AUTH_USER_MODEL
)),
],
],
...
@@ -52,7 +52,7 @@ class Migration(migrations.Migration):
...
@@ -52,7 +52,7 @@ class Migration(migrations.Migration):
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'
)),
(
'created'
,
models
.
DateTimeField
(
auto_now_add
=
True
)),
(
'created'
,
models
.
DateTimeField
(
auto_now_add
=
True
)),
(
'title'
,
models
.
CharField
(
blank
=
True
,
default
=
b
''
,
max_length
=
100
)),
(
'title'
,
models
.
CharField
(
blank
=
True
,
default
=
''
,
max_length
=
100
)),
(
'content'
,
models
.
TextField
()),
(
'content'
,
models
.
TextField
()),
(
'companyId'
,
models
.
ForeignKey
(
null
=
True
,
on_delete
=
django
.
db
.
models
.
deletion
.
CASCADE
,
to
=
'core.Company'
)),
(
'companyId'
,
models
.
ForeignKey
(
null
=
True
,
on_delete
=
django
.
db
.
models
.
deletion
.
CASCADE
,
to
=
'core.Company'
)),
],
],
...
@@ -64,7 +64,7 @@ class Migration(migrations.Migration):
...
@@ -64,7 +64,7 @@ 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'
)),
(
'content'
,
models
.
TextField
()),
(
'content'
,
models
.
TextField
(
blank
=
True
)),
(
'created'
,
models
.
DateTimeField
(
auto_now_add
=
True
)),
(
'created'
,
models
.
DateTimeField
(
auto_now_add
=
True
)),
(
'updated'
,
models
.
DateTimeField
(
auto_now
=
True
)),
(
'updated'
,
models
.
DateTimeField
(
auto_now
=
True
)),
],
],
...
@@ -79,16 +79,16 @@ class Migration(migrations.Migration):
...
@@ -79,16 +79,16 @@ class Migration(migrations.Migration):
(
'created'
,
models
.
DateTimeField
(
auto_now_add
=
True
)),
(
'created'
,
models
.
DateTimeField
(
auto_now_add
=
True
)),
(
'updated'
,
models
.
DateTimeField
(
auto_now
=
True
)),
(
'updated'
,
models
.
DateTimeField
(
auto_now
=
True
)),
(
'npm'
,
models
.
IntegerField
(
unique
=
True
,
validators
=
[
core
.
lib
.
validators
.
validate_npm
])),
(
'npm'
,
models
.
IntegerField
(
unique
=
True
,
validators
=
[
core
.
lib
.
validators
.
validate_npm
])),
(
'resume'
,
models
.
FileField
(
blank
=
True
,
null
=
True
,
upload_to
=
core
.
models
.
accounts
.
get_student_resume_file_path
,
validators
=
[
django
.
core
.
validators
.
FileExtensionValidator
([
b
'pdf'
])])),
(
'resume'
,
models
.
FileField
(
blank
=
True
,
null
=
True
,
upload_to
=
core
.
models
.
accounts
.
get_student_resume_file_path
,
validators
=
[
django
.
core
.
validators
.
FileExtensionValidator
([
'pdf'
])])),
(
'sertifikat'
,
models
.
FileField
(
blank
=
True
,
null
=
True
,
upload_to
=
core
.
models
.
accounts
.
get_student_sertifikat_file_path
,
validators
=
[
core
.
lib
.
validators
.
validate_document_file_extension
])),
(
'sertifikat'
,
models
.
FileField
(
blank
=
True
,
null
=
True
,
upload_to
=
core
.
models
.
accounts
.
get_student_sertifikat_file_path
,
validators
=
[
core
.
lib
.
validators
.
validate_document_file_extension
])),
(
'phone_number'
,
models
.
CharField
(
blank
=
True
,
db_index
=
True
,
max_length
=
100
,
null
=
True
,
validators
=
[
django
.
core
.
validators
.
RegexValidator
(
b
'^0
\\
d{1,11}$'
)])),
(
'phone_number'
,
models
.
CharField
(
blank
=
True
,
db_index
=
True
,
max_length
=
100
,
null
=
True
,
validators
=
[
django
.
core
.
validators
.
RegexValidator
(
'^0
\\
d{1,11}$'
)])),
(
'gender'
,
models
.
CharField
(
blank
=
True
,
max_length
=
30
,
null
=
True
)),
(
'gender'
,
models
.
CharField
(
blank
=
True
,
max_length
=
30
,
null
=
True
)),
(
'birth_place'
,
models
.
CharField
(
blank
=
True
,
max_length
=
30
,
null
=
True
)),
(
'birth_place'
,
models
.
CharField
(
blank
=
True
,
max_length
=
30
,
null
=
True
)),
(
'birth_date'
,
models
.
DateField
(
blank
=
True
,
null
=
True
)),
(
'birth_date'
,
models
.
DateField
(
blank
=
True
,
null
=
True
)),
(
'major'
,
models
.
CharField
(
blank
=
True
,
max_length
=
30
,
null
=
True
)),
(
'major'
,
models
.
CharField
(
blank
=
True
,
max_length
=
30
,
null
=
True
)),
(
'batch'
,
models
.
CharField
(
blank
=
True
,
max_length
=
4
,
null
=
True
)),
(
'batch'
,
models
.
CharField
(
blank
=
True
,
max_length
=
4
,
null
=
True
)),
(
'show_transcript'
,
models
.
BooleanField
(
default
=
False
)),
(
'show_transcript'
,
models
.
BooleanField
(
default
=
False
)),
(
'photo'
,
models
.
FileField
(
blank
=
True
,
null
=
True
,
upload_to
=
core
.
models
.
accounts
.
get_student_photo_file_path
,
validators
=
[
django
.
core
.
validators
.
FileExtensionValidator
([
b
'jpg'
,
b
'jpeg'
,
b
'png'
])])),
(
'photo'
,
models
.
FileField
(
blank
=
True
,
null
=
True
,
upload_to
=
core
.
models
.
accounts
.
get_student_photo_file_path
,
validators
=
[
django
.
core
.
validators
.
FileExtensionValidator
([
'jpg'
,
'jpeg'
,
'png'
])])),
(
'self_description'
,
models
.
CharField
(
blank
=
True
,
db_index
=
True
,
max_length
=
500
,
null
=
True
)),
(
'self_description'
,
models
.
CharField
(
blank
=
True
,
db_index
=
True
,
max_length
=
500
,
null
=
True
)),
(
'portfolio_link'
,
models
.
URLField
(
blank
=
True
,
null
=
True
)),
(
'portfolio_link'
,
models
.
URLField
(
blank
=
True
,
null
=
True
)),
(
'linkedin_url'
,
models
.
URLField
(
blank
=
True
,
null
=
True
)),
(
'linkedin_url'
,
models
.
URLField
(
blank
=
True
,
null
=
True
)),
...
@@ -104,9 +104,10 @@ class Migration(migrations.Migration):
...
@@ -104,9 +104,10 @@ class Migration(migrations.Migration):
(
'github_url'
,
models
.
URLField
(
blank
=
True
,
null
=
True
)),
(
'github_url'
,
models
.
URLField
(
blank
=
True
,
null
=
True
)),
(
'gitlab_url'
,
models
.
URLField
(
blank
=
True
,
null
=
True
)),
(
'gitlab_url'
,
models
.
URLField
(
blank
=
True
,
null
=
True
)),
(
'intro'
,
models
.
CharField
(
blank
=
True
,
max_length
=
50
,
null
=
True
)),
(
'intro'
,
models
.
CharField
(
blank
=
True
,
max_length
=
50
,
null
=
True
)),
(
'expected_salary'
,
models
.
CharField
(
blank
=
True
,
max_length
=
10
,
null
=
True
,
validators
=
[
django
.
core
.
validators
.
RegexValidator
(
b
'^
\\
d{0,10}$'
)])),
(
'expected_salary'
,
models
.
CharField
(
blank
=
True
,
max_length
=
10
,
null
=
True
,
validators
=
[
django
.
core
.
validators
.
RegexValidator
(
'^
\\
d{0,10}$'
)])),
(
'job_seeking_status'
,
models
.
CharField
(
blank
=
True
,
max_length
=
30
,
null
=
True
)),
(
'job_seeking_status'
,
models
.
CharField
(
blank
=
True
,
max_length
=
30
,
null
=
True
)),
(
'student_gpa'
,
models
.
FloatField
(
blank
=
True
,
db_column
=
b
'student_gpa'
,
default
=
1.0
,
null
=
True
,
validators
=
[
core
.
lib
.
validators
.
validate_student_gpa
])),
(
'student_gpa'
,
models
.
FloatField
(
blank
=
True
,
db_column
=
'student_gpa'
,
default
=
1.0
,
null
=
True
,
validators
=
[
core
.
lib
.
validators
.
validate_student_gpa
])),
(
'student_toefl'
,
models
.
CharField
(
blank
=
True
,
max_length
=
3
,
null
=
True
)),
(
'volunteer'
,
models
.
CharField
(
blank
=
True
,
max_length
=
100
,
null
=
True
)),
(
'volunteer'
,
models
.
CharField
(
blank
=
True
,
max_length
=
100
,
null
=
True
)),
(
'awards'
,
models
.
CharField
(
blank
=
True
,
max_length
=
100
,
null
=
True
)),
(
'awards'
,
models
.
CharField
(
blank
=
True
,
max_length
=
100
,
null
=
True
)),
(
'projects'
,
models
.
CharField
(
blank
=
True
,
max_length
=
100
,
null
=
True
)),
(
'projects'
,
models
.
CharField
(
blank
=
True
,
max_length
=
100
,
null
=
True
)),
...
@@ -114,7 +115,7 @@ class Migration(migrations.Migration):
...
@@ -114,7 +115,7 @@ class Migration(migrations.Migration):
(
'languages'
,
models
.
CharField
(
blank
=
True
,
max_length
=
100
,
null
=
True
)),
(
'languages'
,
models
.
CharField
(
blank
=
True
,
max_length
=
100
,
null
=
True
)),
(
'seminar'
,
models
.
CharField
(
blank
=
True
,
max_length
=
100
,
null
=
True
)),
(
'seminar'
,
models
.
CharField
(
blank
=
True
,
max_length
=
100
,
null
=
True
)),
(
'interests'
,
models
.
CharField
(
blank
=
True
,
max_length
=
100
,
null
=
True
)),
(
'interests'
,
models
.
CharField
(
blank
=
True
,
max_length
=
100
,
null
=
True
)),
(
'dependants'
,
models
.
IntegerField
(
blank
=
True
,
db_column
=
b
'dependants'
,
default
=
0
,
null
=
True
)),
(
'dependants'
,
models
.
IntegerField
(
blank
=
True
,
db_column
=
'dependants'
,
default
=
0
,
null
=
True
)),
],
],
options
=
{
options
=
{
'ordering'
:
[
'-updated'
],
'ordering'
:
[
'-updated'
],
...
@@ -174,7 +175,7 @@ class Migration(migrations.Migration):
...
@@ -174,7 +175,7 @@ class Migration(migrations.Migration):
name
=
'ReasonRejected'
,
name
=
'ReasonRejected'
,
fields
=
[
fields
=
[
(
'application'
,
models
.
ForeignKey
(
on_delete
=
django
.
db
.
models
.
deletion
.
CASCADE
,
primary_key
=
True
,
serialize
=
False
,
to
=
'core.Application'
)),
(
'application'
,
models
.
ForeignKey
(
on_delete
=
django
.
db
.
models
.
deletion
.
CASCADE
,
primary_key
=
True
,
serialize
=
False
,
to
=
'core.Application'
)),
(
'reason'
,
models
.
TextField
(
default
=
b
'Tidak memenuhi kualifikasi perusahaan.'
)),
(
'reason'
,
models
.
TextField
(
default
=
'Tidak memenuhi kualifikasi perusahaan.'
)),
],
],
),
),
migrations
.
AddField
(
migrations
.
AddField
(
...
@@ -200,12 +201,12 @@ class Migration(migrations.Migration):
...
@@ -200,12 +201,12 @@ class Migration(migrations.Migration):
migrations
.
AddField
(
migrations
.
AddField
(
model_name
=
'recommendation'
,
model_name
=
'recommendation'
,
name
=
'recommendation_giver'
,
name
=
'recommendation_giver'
,
field
=
models
.
ForeignKey
(
on_delete
=
django
.
db
.
models
.
deletion
.
CASCADE
,
related_name
=
'giver'
,
to
=
'core.Student'
),
field
=
models
.
ForeignKey
(
null
=
True
,
on_delete
=
django
.
db
.
models
.
deletion
.
CASCADE
,
related_name
=
'giver'
,
to
=
'core.Student'
),
),
),
migrations
.
AddField
(
migrations
.
AddField
(
model_name
=
'recommendation'
,
model_name
=
'recommendation'
,
name
=
'recommendation_receiver'
,
name
=
'recommendation_receiver'
,
field
=
models
.
ForeignKey
(
on_delete
=
django
.
db
.
models
.
deletion
.
CASCADE
,
related_name
=
'receiver'
,
to
=
'core.Student'
),
field
=
models
.
ForeignKey
(
null
=
True
,
on_delete
=
django
.
db
.
models
.
deletion
.
CASCADE
,
related_name
=
'receiver'
,
to
=
'core.Student'
),
),
),
migrations
.
AddField
(
migrations
.
AddField
(
model_name
=
'feedback'
,
model_name
=
'feedback'
,
...
...
core/migrations/0002_auto_20191116_1550.py
deleted
100644 → 0
View file @
003cdc07
# -*- coding: utf-8 -*-
# Generated by Django 1.11.17 on 2019-12-01 10:01
from
__future__
import
unicode_literals
import
django.core.validators
from
django.db
import
migrations
,
models
import
django.db.models.deletion
class
Migration
(
migrations
.
Migration
):
dependencies
=
[
(
'core'
,
'0001_initial'
),
]
operations
=
[
migrations
.
AlterField
(
model_name
=
'company'
,
name
=
'status'
,
field
=
models
.
IntegerField
(
default
=
0
,
validators
=
[
django
.
core
.
validators
.
MaxValueValidator
(
2
),
django
.
core
.
validators
.
MinValueValidator
(
0
)]),
),
migrations
.
AlterField
(
model_name
=
'recommendation'
,
name
=
'content'
,
field
=
models
.
TextField
(
blank
=
True
),
),
migrations
.
AlterField
(
model_name
=
'recommendation'
,
name
=
'recommendation_giver'
,
field
=
models
.
ForeignKey
(
null
=
True
,
on_delete
=
django
.
db
.
models
.
deletion
.
CASCADE
,
related_name
=
'giver'
,
to
=
'core.Student'
),
),
migrations
.
AlterField
(
model_name
=
'recommendation'
,
name
=
'recommendation_receiver'
,
field
=
models
.
ForeignKey
(
null
=
True
,
on_delete
=
django
.
db
.
models
.
deletion
.
CASCADE
,
related_name
=
'receiver'
,
to
=
'core.Student'
),
),
]
core/migrations/0002_auto_20191203_1051.py
0 → 100644
View file @
e94df367
# -*- coding: utf-8 -*-
# Generated by Django 1.11.17 on 2019-12-03 03:51
from
__future__
import
unicode_literals
from
django.db
import
migrations
,
models
class
Migration
(
migrations
.
Migration
):
dependencies
=
[
(
'core'
,
'0001_initial'
),
]
operations
=
[
migrations
.
AlterField
(
model_name
=
'student'
,
name
=
'student_toefl'
,
field
=
models
.
IntegerField
(
blank
=
True
,
db_column
=
'toefl'
,
default
=
0
,
null
=
True
),
),
]
core/models/accounts.py
View file @
e94df367
...
@@ -111,7 +111,7 @@ class Student(models.Model):
...
@@ -111,7 +111,7 @@ class Student(models.Model):
job_seeking_status
=
models
.
CharField
(
max_length
=
30
,
blank
=
True
,
null
=
True
)
job_seeking_status
=
models
.
CharField
(
max_length
=
30
,
blank
=
True
,
null
=
True
)
student_gpa
=
models
.
FloatField
(
db_column
=
'student_gpa'
,
default
=
1.0
,
blank
=
True
,
null
=
True
,
student_gpa
=
models
.
FloatField
(
db_column
=
'student_gpa'
,
default
=
1.0
,
blank
=
True
,
null
=
True
,
validators
=
[
validate_student_gpa
])
validators
=
[
validate_student_gpa
])
student_toefl
=
models
.
Cha
rField
(
max_length
=
3
,
blank
=
True
,
null
=
True
)
student_toefl
=
models
.
Intege
rField
(
db_column
=
'toefl'
,
default
=
0
,
blank
=
True
,
null
=
True
)
volunteer
=
models
.
CharField
(
max_length
=
100
,
blank
=
True
,
null
=
True
)
volunteer
=
models
.
CharField
(
max_length
=
100
,
blank
=
True
,
null
=
True
)
awards
=
models
.
CharField
(
max_length
=
100
,
blank
=
True
,
null
=
True
)
awards
=
models
.
CharField
(
max_length
=
100
,
blank
=
True
,
null
=
True
)
projects
=
models
.
CharField
(
max_length
=
100
,
blank
=
True
,
null
=
True
)
projects
=
models
.
CharField
(
max_length
=
100
,
blank
=
True
,
null
=
True
)
...
...
core/tests/test_accounts.py
View file @
e94df367
...
@@ -395,9 +395,9 @@ class ProfileUpdateTests(APITestCase):
...
@@ -395,9 +395,9 @@ class ProfileUpdateTests(APITestCase):
self
.
assertEqual
(
response
.
status_code
,
status
.
HTTP_202_ACCEPTED
)
self
.
assertEqual
(
response
.
status_code
,
status
.
HTTP_202_ACCEPTED
)
url
=
'/api/students/'
+
str
(
student_id
)
+
"/profile/"
url
=
'/api/students/'
+
str
(
student_id
)
+
"/profile/"
response
=
self
.
client
.
patch
(
url
,
{
'TOEFL'
:
50
0
},
format
=
'multipart'
)
response
=
self
.
client
.
patch
(
url
,
{
'TOEFL'
:
0
},
format
=
'multipart'
)
self
.
assertEqual
(
response
.
status_code
,
status
.
HTTP_202_ACCEPTED
)
self
.
assertEqual
(
response
.
status_code
,
status
.
HTTP_202_ACCEPTED
)
self
.
assertEqual
(
response
.
data
.
get
(
'student_toefl'
),
50
0
)
self
.
assertEqual
(
response
.
data
.
get
(
'student_toefl'
),
0
)
url
=
'/api/students/'
+
str
(
student_id
)
+
"/profile/"
url
=
'/api/students/'
+
str
(
student_id
)
+
"/profile/"
response
=
self
.
client
.
patch
(
url
,
{
'student_toefl'
:
'this is not valid input'
},
format
=
'multipart'
)
response
=
self
.
client
.
patch
(
url
,
{
'student_toefl'
:
'this is not valid input'
},
format
=
'multipart'
)
...
...
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