Ticket #23101: models-0002.py

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

models-0002

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 Onesie(Filler):
15 "this will test for #22975 bug - model name changed, db_table keeps it the same"
16 class Meta:
17 db_table = "x_one"
18
19
20class Twosies(Filler):
21 "does not ignore db_table in init, color me surprised. okay, test reverse of #22975"
22 pass
23
24
25class Three(Filler):
26 "this will be the new bug - M2M field name changed, db_table keeping old table name ignored"
27 ringsies = ManyToManyField("Ring", db_table="x_three_ring")
28
29
30class Four(Filler):
31 "this will test implicitly suspected bug, original db_table ignored, too"
32 "phase two, verify that reverse is equally broken (must be, huh?)"
33 ring = ManyToManyField("Ring", db_table="x_four_ringsie")
34
Back to Top