12 lines
365 B
Python
12 lines
365 B
Python
from django.db import models
|
|
from django.contrib.auth.models import User
|
|
|
|
class Todo(models.Model):
|
|
user = models.ForeignKey(User, on_delete=models.CASCADE)
|
|
title = models.CharField(max_length=200)
|
|
completed = models.BooleanField(default=False)
|
|
created_at = models.DateTimeField(auto_now_add=True)
|
|
|
|
def __str__(self):
|
|
return self.title
|
|
|