Fakultas Ilmu Komputer UI

models.py 2.62 KB
Newer Older
1
2
3
4
5
from django.db import models


class Sekolah(models.Model):
    STATUS_SEKOLAH = (
6
7
8
        ("SW", "Swasta"),
        ("NG", "Negri"),
        ("IT", "Internasional")
9
10
    )
    JENIS = (
11
12
        ("IK", "Inklusi"),
        ("SG", "Segregasi")
13
14
15
16
17
18
19
20
21
    )
    name = models.CharField(max_length=50)
    alamat = models.CharField(max_length=100)
    no_telp = models.CharField(max_length=16)
    website = models.URLField(null=True)
    jumlah_siswa = models.IntegerField()
    status = models.CharField(
        max_length=2,
        choices=STATUS_SEKOLAH,
22
        default="SW"
23
24
25
    )
    jenis_sekolah = models.CharField(
        max_length=2,
M. Abdurrahman's avatar
Coldfix    
M. Abdurrahman committed
26
        choices=JENIS,
27
        default="IK"
28
29
    )
    akreditasi = models.CharField(max_length=1, null=True, default=None)
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97


class Penyandang(models.Model):
    JENIS_KELAMIN_OPTION = (
        ("LAKI-LAKI", "Laki-Laki"),
        ("PEREMPUAN", "Perempuan")
    )
    PENDIDIKAN_TERAKHIR = (
        ("SD", "SD"),
        ("MP", "SMP/SLTP"),
        ("MA", "SMA/SLTA"),
        ("D1", "Diploma 1"),
        ("D2", "Diploma 2"),
        ("D3", "Diploma 3"),
        ("S1", "Sarjana"),
        ("S2", "Magister"),
        ("S3", "Doktor"),
        ("NF", "Non-Formal/Lainnya"),
        ("NA", "Tidak Sekolah")
    )
    PEKERJAAN_OPTION = (
        ("PT", "Petani"),
        ("BR", "Buruh"),
        ("WS", "Pedagang/Wiraswasta"),
        ("JS", "Jasa"),
        ("PN", "PNS/TNI/POLRI"),
        ("SN", "Pensiunan"),
        ("IR", "Ibu Rumah Tangga"),
        ("PL", "Pelajar"),
        ("LA", "Lainnya"),
        ("NA", "Tidak Bekerja")
    )
    KATEGORI_DISABILITAS = (
        ("FS", "Fisik"),
        ("IN", "Intelektual"),
        ("MN", "Mental"),
        ("SN", "Sensorik")
    )
    name = models.CharField(max_length=50)
    alamat = models.CharField(max_length=100)
    tempat_lahir = models.CharField(max_length=50)
    tanggal_lahir = models.DateField()
    jenis_kelamin = models.CharField(
        max_length=9,
        choices=JENIS_KELAMIN_OPTION,
        default="LAKI-LAkI"
    )
    pendidikan = models.CharField(
        max_length=2,
        choices=PENDIDIKAN_TERAKHIR,
        default="NA"
    )
    pekerjaan = models.CharField(
        max_length=2,
        choices=PEKERJAAN_OPTION,
        default="NA"
    )
    kategori = models.CharField(
        max_length=2,
        choices=KATEGORI_DISABILITAS,
        default="FS"
    )
    no_telp = models.CharField(max_length=16, null=True)
    email = models.CharField(max_length=50, null=True)

    nama_wali = models.CharField(max_length=50, null=True)
    alamat_wali = models.CharField(max_length=100, null=True)
    telp_wali = models.CharField(max_length=16, null=True)