Created
May 16, 2022 05:18
-
-
Save agusrichard/a0f27471b94426df538cc8965ab5756a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.db import models | |
from django.contrib.auth.models import User | |
class Todo(models.Model): | |
title = models.CharField(max_length=100, null=False, blank=False, default=None) | |
description = models.TextField(null=False, blank=False, default=None) | |
completed = models.BooleanField(default=False) | |
created_at = models.DateTimeField(auto_now_add=True) | |
user = models.ForeignKey(User, on_delete=models.CASCADE) | |
def __str__(self): | |
return str(self.title) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment