Skip to content

Instantly share code, notes, and snippets.

@bogsio
Created November 25, 2013 21:21
Show Gist options
  • Save bogsio/7649122 to your computer and use it in GitHub Desktop.
Save bogsio/7649122 to your computer and use it in GitHub Desktop.
from django.db import models
from django.contrib.auth.models import User
class TodoList(models.Model):
name = models.CharField('List Title', max_length=200)
author = models.ForeignKey(User, related_name='todo_lists')
class TodoItem(models.Model):
text = models.TextField('Item Text')
todo_list = models.ForeignKey(TodoList, related_name='items')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment