-
Notifications
You must be signed in to change notification settings - Fork 81
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
33 additions
and
19 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
dist/ | ||
aldjemy.egg-info/ | ||
*.pyc | ||
ve/ |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,6 @@ | ||
from django.db import models as m | ||
from sample.models import G | ||
from sample.models import Book | ||
|
||
# Create your models here. | ||
|
||
class GP(G): | ||
class BookProxy(Book): | ||
class Meta: | ||
proxy=True | ||
proxy = True |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,25 @@ | ||
from django.db import models as m | ||
from django.db import models | ||
|
||
# Create your models here. | ||
|
||
class G(m.Model): | ||
a = m.CharField(max_length="200") | ||
class Chapter(models.Model): | ||
title = models.CharField(max_length=200) | ||
book = models.ForeignKey('Book') | ||
|
||
|
||
class M(m.Model): | ||
a = m.CharField(max_length="200") | ||
b = m.TextField() | ||
class Book(models.Model): | ||
title = models.CharField(max_length=200) | ||
|
||
g = m.ManyToManyField(G, related_name='cc_lprojects') | ||
|
||
class MN(M): | ||
c = m.TextField() | ||
class Author(models.Model): | ||
name = models.CharField(max_length=200) | ||
biography = models.TextField() | ||
|
||
books = models.ManyToManyField(Book, related_name='books') | ||
|
||
|
||
class StaffAuthor(Author): | ||
role = models.TextField() | ||
|
||
|
||
class Review(models.Model): | ||
book = models.ForeignKey('a_sample.BookProxy') |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
from sample.models import MN | ||
from sample.models import StaffAuthor | ||
|
||
print MN.sa.query().all() | ||
print StaffAuthor.sa.query().all() |