1 | from django.db.models import CharField, ManyToManyField, Model
|
---|
2 |
|
---|
3 |
|
---|
4 | class Filler(Model):
|
---|
5 | name = CharField(max_length=40)
|
---|
6 | class Meta:
|
---|
7 | abstract=True
|
---|
8 |
|
---|
9 | class Ring(Filler):
|
---|
10 | "...to bring them all and in the darkness bind them"
|
---|
11 | pass
|
---|
12 |
|
---|
13 |
|
---|
14 | class One(Filler):
|
---|
15 | "this will test for #22975 bug - model name changed, db_table keeps it the same"
|
---|
16 | pass
|
---|
17 |
|
---|
18 |
|
---|
19 | class 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 |
|
---|
25 | class 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 |
|
---|
30 | class Four(Filler):
|
---|
31 | "this will test implicitly suspected bug, original db_table ignored, too"
|
---|
32 | ringsie = ManyToManyField("Ring", db_table="x_four_ring")
|
---|
33 |
|
---|