Ticket #23160: models_after.py
File models_after.py, 503 bytes (added by , 10 years ago) |
---|
Line | |
---|---|
1 | from django.db import models |
2 | |
3 | |
4 | class Bar(models.Model): |
5 | name = models.CharField(unique=True, max_length=32) |
6 | description = models.TextField(null=True, blank=True) |
7 | parent = models.ForeignKey( |
8 | "self", |
9 | null=True, |
10 | blank=True |
11 | ) |
12 | |
13 | |
14 | class SomeModel(models.Model): |
15 | foo = models.ForeignKey(Bar) |
16 | some_field = models.CharField(max_length=256) |
17 | |
18 | |
19 | class YetAnotherModel(models.Model): |
20 | foo = models.ForeignKey(Bar) |
21 | another_field = models.BooleanField(default=True) |