27 lines
843 B
Python
27 lines
843 B
Python
from django.db import models
|
|
|
|
class Article(models.Model):
|
|
title = models.CharField(max_length=200)
|
|
content = models.TextField()
|
|
created_at = models.DateTimeField(auto_now_add=True)
|
|
|
|
def __str__(self):
|
|
return self.title
|
|
|
|
class TodoItem(models.Model):
|
|
STATUS_CHOICES = [
|
|
('todo', 'To Do'),
|
|
('inprogress', 'In Progress'),
|
|
('blocked', 'Blocked'),
|
|
('done', 'Done'),
|
|
]
|
|
title = models.CharField(max_length=200)
|
|
description = models.TextField(blank=True, null=True)
|
|
tags = models.CharField(max_length=255, blank=True, null=True)
|
|
status = models.CharField(max_length=20, choices=STATUS_CHOICES, default='todo')
|
|
created_at = models.DateTimeField(auto_now_add=True)
|
|
updated_at = models.DateTimeField(auto_now=True)
|
|
|
|
def __str__(self):
|
|
return self.title
|