Created
August 30, 2011 02:58
-
-
Save edsu/1180064 to your computer and use it in GitHub Desktop.
django models module
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 | |
| class Book(models.Model): | |
| title = models.CharField(max_length=15) | |
| class Author(models.Model): | |
| name = models.CharField(max_length=255) | |
| book = models.ForeignKey('Book', related_name='authors') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment