Fakultas Ilmu Komputer UI

models.py 876 Bytes
Newer Older
addffa's avatar
addffa committed
1
2
3
from django.db import models

# Create your models here.
addffa's avatar
addffa committed
4
5
6


class Mustahik(models.Model):
addffa's avatar
addffa committed
7
8
9
10
11
12
13

    class Status(models.TextChoices):
        JANDA = ('JANDA', 'Janda')
        MISKIN = ('MISKIN', 'Miskin')
        YATIM = ('YATIM', 'Yatim')

    name = models.CharField(max_length=32)
14
    no_ktp = models.CharField(max_length=32, unique=True)
addffa's avatar
addffa committed
15
16
17
18
19
20
21
22
23
24
25
26
27
28
    phone = models.CharField(max_length=32, blank=True)
    address = models.TextField()
    province = models.CharField(max_length=32)
    regency = models.CharField(max_length=32)
    rt = models.CharField(max_length=4)
    rw = models.CharField(max_length=4)
    birthdate = models.DateField()
    status = models.CharField(
        max_length=32,
        choices=Status.choices,
        default=Status.MISKIN,
    )
    family_size = models.PositiveSmallIntegerField()
    description = models.TextField()