Tag Archives: Django register model

Building a To Do Application in Python using Django Framework – Part 03

In this third part we are going to create the model for out todo item. The model is going to be created into the file named models.py from within the folder todo. So, in the models.py file paste the following code:

from django.db import models

class TodoItem(models.Model):
    name = models.CharField(max_length = 30, blank = False)
    done = models.BooleanField(blank = False, default = False)
    def __str__(self):
        return self.name

Continue reading