basic stuff
This commit is contained in:
36
cookbook/models.py
Normal file
36
cookbook/models.py
Normal file
@ -0,0 +1,36 @@
|
||||
from django.db import models
|
||||
|
||||
|
||||
class Keyword(models.Model):
|
||||
name = models.CharField(max_length=64)
|
||||
description = models.TextField(default="")
|
||||
created_by = models.IntegerField(default=0)
|
||||
created_at = models.DateTimeField(auto_now_add=True)
|
||||
updated_at = models.DateTimeField(auto_now=True)
|
||||
|
||||
def __str__(self):
|
||||
return self.name
|
||||
|
||||
|
||||
class Category(models.Model):
|
||||
name = models.CharField(max_length=64)
|
||||
description = models.TextField(default="")
|
||||
created_by = models.IntegerField(default=0)
|
||||
created_at = models.DateTimeField(auto_now_add=True)
|
||||
updated_at = models.DateTimeField(auto_now=True)
|
||||
|
||||
def __str__(self):
|
||||
return self.name
|
||||
|
||||
|
||||
class Recipe(models.Model):
|
||||
name = models.CharField(max_length=64)
|
||||
path = models.CharField
|
||||
category = models.ForeignKey(Category, on_delete=models.CASCADE)
|
||||
keywords = models.ManyToManyField(Keyword)
|
||||
created_by = models.IntegerField(default=0)
|
||||
created_at = models.DateTimeField(auto_now_add=True)
|
||||
updated_at = models.DateTimeField(auto_now=True)
|
||||
|
||||
def __str__(self):
|
||||
return self.name
|
Reference in New Issue
Block a user