Fakultas Ilmu Komputer UI

Commit b8f2563e authored by Farhan Farasdak's avatar Farhan Farasdak
Browse files

[#140382397] #8 Update Database for Vacancies and Applications

parent eaa8dbc0
from django.contrib import admin
from core.models import Application
from core.models import Vacancy
from core.models.accounts import Company, Supervisor, Student
admin.site.register(Company)
admin.site.register(Student)
admin.site.register(Supervisor)
\ No newline at end of file
admin.site.register(Supervisor)
admin.site.register(Vacancy)
admin.site.register(Application)
# -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2017-03-20 09:50
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('core', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='Application',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('student_npm', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to='core.Student')),
],
),
migrations.CreateModel(
name='Vacancy',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('verified', models.BooleanField(default=False)),
('open_time', models.DateTimeField()),
('close_time', models.DateTimeField()),
('company_id', models.ManyToManyField(to='core.Company')),
],
),
migrations.AddField(
model_name='application',
name='vacancy_id',
field=models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to='core.Vacancy'),
),
]
# __init__.py
from core.models.accounts import Supervisor
from core.models.accounts import Student
from core.models.accounts import Company
from core.models.vacancies import Vacancy
from core.models.vacancies import Application
import os
import uuid
from django.db import models
from core.models.accounts import Company, Student
class Vacancy(models.Model):
company_id = models.ManyToManyField(Company)
verified = models.BooleanField(default=False)
open_time = models.DateTimeField()
close_time = models.DateTimeField()
class Application(models.Model):
student_npm = models.OneToOneField(Student)
vacancy_id = models.OneToOneField(Vacancy)
\ No newline at end of file
......@@ -6,7 +6,6 @@ from rest_framework.response import Response
from core.models.accounts import Student, Company, Supervisor
from core.serializers.accounts import UserSerializer, StudentSerializer, CompanySerializer, SupervisorSerializer
class UserViewSet(viewsets.ModelViewSet):
queryset = User.objects.all()
serializer_class = UserSerializer
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment