Fakultas Ilmu Komputer UI

models.py 366 Bytes
Newer Older
1
2
3
from django.db import models

# Create your models here.
4
5
6
7

class List(models.Model):
    pass

8
class Item(models.Model):
9
10
    text = models.TextField(default='')
    list = models.ForeignKey(List, default=None,on_delete=models.CASCADE)
Muhammad Ilham Peruzzi's avatar
Muhammad Ilham Peruzzi committed
11
12
13
14
15
    slug = models.SlugField(blank=True)
    
    class Meta:
        ordering = ('id',)
        unique_together = ('list', 'text')
16