Skip to content

Instantly share code, notes, and snippets.

@zmsmith
Created August 20, 2010 14:01
Show Gist options
  • Save zmsmith/540375 to your computer and use it in GitHub Desktop.
Save zmsmith/540375 to your computer and use it in GitHub Desktop.
from django.db import models
class Author(models.Model):
first_name = models.CharField(max_length=255)
last_name = models.CharField(max_length=255)
books = models.ManyToManyField('Book')
class Book(models.Model):
title = models.CharField(max_length=255)
class BookStore(model.Model):
name = models.CharField(max_length=255)
books = models.ManyToManyField('Book')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment