Created
November 9, 2012 22:04
-
-
Save kennethlove/4048594 to your computer and use it in GitHub Desktop.
This file contains 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
class Book(models.Model): | |
title = models.CharField(max_length=255) | |
author = models.CharField(max_length=255) # you probably want this to be an FK to another model | |
class BookList(models.Model): | |
title = models.CharField(max_length=255) | |
user = models.ForeignKey(User, related_name="booklists") # imported from django.contrib.auth.models | |
books = models.ManyToMany(Book, related_name="lists") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment