Created
May 4, 2015 14:06
-
-
Save lardissone/699be47588faa779398d 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 Author(models.Model): | |
name = models.CharField(max_length=200) | |
class Book(models.Model): | |
title = models.CharField(max_length=200) | |
author = models.ForeignKey(Author) | |
# here it is: | |
# this should start from 1 for the same author | |
# examples: | |
# author1 | 1 | |
# author1 | 2 | |
# author2 | 1 | |
# author1 | 3 | |
# author2 | 2 | |
# ... | |
sort_id = models.AutoField() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment