Ticket #23101: models-0001.py

File models-0001.py, 846 bytes (added by maney@…, 10 years ago)

models-0001

Line 
1from django.db.models import CharField, ManyToManyField, Model
2
3
4class Filler(Model):
5 name = CharField(max_length=40)
6 class Meta:
7 abstract=True
8
9class Ring(Filler):
10 "...to bring them all and in the darkness bind them"
11 pass
12
13
14class One(Filler):
15 "this will test for #22975 bug - model name changed, db_table keeps it the same"
16 pass
17
18
19class Two(Filler):
20 "this will test for the bug (not reported?) that's implied by #22975, just ignores db_table?"
21 class Meta:
22 db_table = "x_twosies"
23
24
25class Three(Filler):
26 "this will be the new bug - M2M field name changed, db_table keeping old table name ignored"
27 ring = ManyToManyField("Ring")
28
29
30class Four(Filler):
31 "this will test implicitly suspected bug, original db_table ignored, too"
32 ringsie = ManyToManyField("Ring", db_table="x_four_ring")
33
Back to Top